Browse Source

CLDC-4169: test updates

pull/3202/head
Nat Dean-Lewis 3 weeks ago
parent
commit
b221569997
  1. 2
      spec/models/form/sales/pages/discounted_ownership_type_spec.rb
  2. 7
      spec/models/form/sales/questions/discounted_ownership_type_spec.rb

2
spec/models/form/sales/pages/discounted_ownership_type_spec.rb

@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::DiscountedOwnershipType, type: :model do
let(:page_id) { nil }
let(:page_definition) { nil }
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?: true)) }
let(:start_date) { Time.zone.today }
it "has correct subsection" do

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

@ -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({

Loading…
Cancel
Save