Browse Source

CLDC-4169: update tests

pull/3202/head
Nat Dean-Lewis 3 weeks ago
parent
commit
f24edac9ba
  1. 2
      spec/fixtures/files/2026_27_sales_bulk_upload.csv
  2. 39
      spec/models/form/sales/questions/discounted_ownership_type_spec.rb

2
spec/fixtures/files/2026_27_sales_bulk_upload.csv vendored

File diff suppressed because one or more lines are too long

39
spec/models/form/sales/questions/discounted_ownership_type_spec.rb

@ -25,16 +25,35 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do
expect(question.derived?(nil)).to be false expect(question.derived?(nil)).to be false
end end
it "has the correct answer_options" do context "when form is for 2025 or earlier" do
expect(question.answer_options).to eq({ let(:start_date) { Time.zone.local(2025, 4, 1) }
"8" => { "value" => "Right to Acquire (RTA)" },
"14" => { "value" => "Preserved Right to Buy (PRTB)" }, it "has the correct answer_options including option 27" do
"27" => { "value" => "Voluntary Right to Buy (VRTB)" }, expect(question.answer_options).to eq({
"9" => { "value" => "Right to Buy (RTB)" }, "8" => { "value" => "Right to Acquire (RTA)" },
"29" => { "value" => "Rent to Buy - Full Ownership" }, "14" => { "value" => "Preserved Right to Buy (PRTB)" },
"21" => { "value" => "Social HomeBuy for outright purchase" }, "27" => { "value" => "Voluntary Right to Buy (VRTB)" },
"22" => { "value" => "Any other equity loan scheme" }, "9" => { "value" => "Right to Buy (RTB)" },
}) "29" => { "value" => "Rent to Buy - Full Ownership" },
"21" => { "value" => "Social HomeBuy for outright purchase" },
"22" => { "value" => "Any other equity loan scheme" },
})
end
end
context "when form is for 2026 or later" do
let(:start_date) { Time.zone.local(2026, 4, 1) }
it "has the correct answer_options without option 27" do
expect(question.answer_options).to eq({
"8" => { "value" => "Right to Acquire (RTA)" },
"14" => { "value" => "Preserved Right to Buy (PRTB)" },
"9" => { "value" => "Right to Buy (RTB)" },
"29" => { "value" => "Rent to Buy - Full Ownership" },
"21" => { "value" => "Social HomeBuy for outright purchase" },
"22" => { "value" => "Any other equity loan scheme" },
})
end
end end
describe "partial guidance" do describe "partial guidance" do

Loading…
Cancel
Save