From 171ba985f0b107bc2d06eceb405b63d996c951be Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:35:52 +0000 Subject: [PATCH] Add answer options test --- .../sales/questions/ownership_scheme_spec.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/models/form/sales/questions/ownership_scheme_spec.rb b/spec/models/form/sales/questions/ownership_scheme_spec.rb index 5d7e535de..647de9621 100644 --- a/spec/models/form/sales/questions/ownership_scheme_spec.rb +++ b/spec/models/form/sales/questions/ownership_scheme_spec.rb @@ -40,7 +40,7 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do }) end - context "with collection year on or after 2024" do + context "with collection year in 2024" do before do allow(form).to receive(:start_year_2024_or_later?).and_return(true) end @@ -53,4 +53,18 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do }) end end + + context "with collection year on or after 2025" do + before do + allow(form).to receive(:start_year_2024_or_later?).and_return(true) + allow(form).to receive(:start_year_2025_or_later?).and_return(true) + end + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "1" => { "value" => "Yes - a shared ownership scheme", "hint" => "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" }, + "2" => { "value" => "Yes - a discounted ownership scheme" }, + }) + end + end end