Browse Source

Update model tests

pull/2751/head
Manny Dinssa 8 months ago
parent
commit
f3bf5abbd9
  1. 6
      spec/models/form/sales/pages/staircase_spec.rb
  2. 2
      spec/models/form/sales/subsections/setup_spec.rb

6
spec/models/form/sales/pages/staircase_spec.rb

@ -5,7 +5,11 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2025_or_later?: false)) }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
before do
allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(false)
end
it "has correct subsection" do
expect(page.subsection).to eq(subsection)

2
spec/models/form/sales/subsections/setup_spec.rb

@ -23,6 +23,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do
context "when start year is before 2024" do
before do
allow(section.form).to receive(:start_year_2024_or_later?).and_return(false)
allow(section.form).to receive(:start_year_2025_or_later?).and_return(false)
end
it "has correct pages" do
@ -49,6 +50,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do
context "when start year is >= 2024" do
before do
allow(section.form).to receive(:start_year_2024_or_later?).and_return(true)
allow(section.form).to receive(:start_year_2025_or_later?).and_return(false)
end
it "has correct pages" do

Loading…
Cancel
Save