Browse Source

test the change to the method creating a link to the next subsection

pull/1368/head
Arthur Campbell 3 years ago
parent
commit
232f4edd1c
  1. 20
      spec/models/form_spec.rb

20
spec/models/form_spec.rb

@ -183,6 +183,26 @@ RSpec.describe Form, type: :model do
expect(form.next_incomplete_section_redirect_path(subsection, lettings_log)).to eq("declaration") expect(form.next_incomplete_section_redirect_path(subsection, lettings_log)).to eq("declaration")
end end
end end
context "when no pages or questions in the next subsection are routed to" do
let(:subsection) { form.get_subsection("setup") }
around do |example|
FormHandler.instance.use_real_forms!
example.run
FormHandler.instance.use_fake_forms!
end
fit "finds the path to the section after" do
lettings_log.startdate = Time.zone.local(2022, 9, 1)
lettings_log.renewal = 1
lettings_log.needstype = 2
lettings_log.postcode_known = 0
expect(form.next_incomplete_section_redirect_path(subsection, lettings_log)).to eq("joint")
end
end
end end
describe "invalidated_page_questions" do describe "invalidated_page_questions" do

Loading…
Cancel
Save