Browse Source

minor changes after rebase

pull/1469/head
Arthur Campbell 3 years ago
parent
commit
72413ce592
  1. 6
      spec/models/form_spec.rb
  2. 8
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

6
spec/models/form_spec.rb

@ -218,7 +218,7 @@ RSpec.describe Form, type: :model do
context "when there are multiple radio questions for attribute X" do context "when there are multiple radio questions for attribute X" do
context "and attribute Y is changed such that a different question for X is routed to" do context "and attribute Y is changed such that a different question for X is routed to" do
let(:log) { FactoryBot.create(:lettings_log, :about_completed, :sheltered_housing, startdate: now, renewal: 0, prevten:) } let(:log) { FactoryBot.create(:lettings_log, :setup_completed, :sheltered_housing, startdate: now, renewal: 0, prevten:) }
context "and the value of X remains valid" do context "and the value of X remains valid" do
let(:prevten) { 36 } let(:prevten) { 36 }
@ -244,7 +244,7 @@ RSpec.describe Form, type: :model do
context "when there is one radio question for attribute X" do context "when there is one radio question for attribute X" do
context "and the start date or sale date is changed such that the collection year changes and there are different options" do context "and the start date or sale date is changed such that the collection year changes and there are different options" do
let(:log) { FactoryBot.create(:lettings_log, :about_completed, :sheltered_housing, startdate: now, sheltered:) } let(:log) { FactoryBot.create(:lettings_log, :setup_completed, :sheltered_housing, startdate: now, sheltered:) }
context "and the value of X remains valid" do context "and the value of X remains valid" do
let(:sheltered) { 2 } let(:sheltered) { 2 }
@ -305,7 +305,7 @@ RSpec.describe Form, type: :model do
end end
context "when a value is changed such that a checkbox question is no longer routed to" do context "when a value is changed such that a checkbox question is no longer routed to" do
let(:log) { FactoryBot.create(:lettings_log, :about_completed, startdate: now, reasonpref: 1, rp_homeless: 1, rp_medwel: 1, rp_hardship: 1) } let(:log) { FactoryBot.create(:lettings_log, :setup_completed, startdate: now, reasonpref: 1, rp_homeless: 1, rp_medwel: 1, rp_hardship: 1) }
it "all attributes relating to that checkbox question are cleared" do it "all attributes relating to that checkbox question are cleared" do
expect(log.rp_homeless).to be 1 expect(log.rp_homeless).to be 1

8
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -793,14 +793,6 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
end end
describe "#field_6" do # renewal describe "#field_6" do # renewal
context "when an unpermitted value" do
let(:attributes) { { bulk_upload:, field_6: "3" } }
it "has errors on the field" do
expect(parser.errors[:field_6]).to be_present
end
end
context "when blank" do context "when blank" do
let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_6: "" } } let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_6: "" } }

Loading…
Cancel
Save