|
|
|
|
@ -6,8 +6,9 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do
|
|
|
|
|
let(:question_id) { nil } |
|
|
|
|
let(:question_definition) { nil } |
|
|
|
|
let(:page) { instance_double(Form::Page, subsection:) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:)) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:, start_year_2026_or_later?: start_year_2026_or_later)) } |
|
|
|
|
let(:start_date) { Time.zone.today } |
|
|
|
|
let(:start_year_2026_or_later) { true } |
|
|
|
|
|
|
|
|
|
it "has correct page" do |
|
|
|
|
expect(question.page).to eq(page) |
|
|
|
|
@ -26,7 +27,7 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when form is for 2025 or earlier" do |
|
|
|
|
let(:start_date) { Time.zone.local(2025, 4, 1) } |
|
|
|
|
let(:start_year_2026_or_later) { false } |
|
|
|
|
|
|
|
|
|
it "has the correct answer_options including option 27" do |
|
|
|
|
expect(question.answer_options).to eq({ |
|
|
|
|
@ -42,7 +43,7 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when form is for 2026 or later" do |
|
|
|
|
let(:start_date) { Time.zone.local(2026, 4, 1) } |
|
|
|
|
let(:start_year_2026_or_later) { true } |
|
|
|
|
|
|
|
|
|
it "has the correct answer_options without option 27" do |
|
|
|
|
expect(question.answer_options).to eq({ |
|
|
|
|
|