Browse Source

various fixes

pull/193/head
MadeTech Dushan 4 years ago
parent
commit
153a381d74
  1. 8
      spec/features/form/page_routing_spec.rb
  2. 2
      spec/models/form_handler_spec.rb

8
spec/features/form/page_routing_spec.rb

@ -75,23 +75,23 @@ RSpec.describe "Form Page Routing" do
context "routing based on start date period", js: true do
it "the first question in tenancy information section is joint tenancy if startdate is in 2022/23 period" do
visit("/case-logs/#{id}/startdate")
visit("/logs/#{id}/startdate")
fill_in("case_log_startdate_3i", with: 10)
fill_in("case_log_startdate_2i", with: 10)
fill_in("case_log_startdate_1i", with: 2022)
click_button("Save and continue")
visit("/case-logs/#{id}")
visit("/logs/#{id}")
click_link(text: "Tenancy information")
expect(page).to have_current_path("/case-logs/#{id}/joint-tenancy")
end
it "the first question in tenancy information section is not joint tenancy if startdate is in 2021/22 period" do
visit("/case-logs/#{id}/startdate")
visit("/logs/#{id}/startdate")
fill_in("case_log_startdate_3i", with: 10)
fill_in("case_log_startdate_2i", with: 10)
fill_in("case_log_startdate_1i", with: 2021)
click_button("Save and continue")
visit("/case-logs/#{id}")
visit("/logs/#{id}")
click_link(text: "Tenancy information")
expect(page).to have_current_path("/case-logs/#{id}/tenancy-code")
end

2
spec/models/form_handler_spec.rb

@ -16,7 +16,7 @@ RSpec.describe FormHandler do
form_handler = FormHandler.instance
form = form_handler.get_form(test_form_name)
expect(form).to be_a(Form)
expect(form.pages.count).to eq(31)
expect(form.pages.count).to eq(30)
end
end

Loading…
Cancel
Save