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
  3. 2
      spec/requests/case_log_controller_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 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 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_3i", with: 10)
fill_in("case_log_startdate_2i", with: 10) fill_in("case_log_startdate_2i", with: 10)
fill_in("case_log_startdate_1i", with: 2022) fill_in("case_log_startdate_1i", with: 2022)
click_button("Save and continue") click_button("Save and continue")
visit("/case-logs/#{id}") visit("/logs/#{id}")
click_link(text: "Tenancy information") click_link(text: "Tenancy information")
expect(page).to have_current_path("/case-logs/#{id}/joint-tenancy") expect(page).to have_current_path("/case-logs/#{id}/joint-tenancy")
end end
it "the first question in tenancy information section is not joint tenancy if startdate is in 2021/22 period" do 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_3i", with: 10)
fill_in("case_log_startdate_2i", with: 10) fill_in("case_log_startdate_2i", with: 10)
fill_in("case_log_startdate_1i", with: 2021) fill_in("case_log_startdate_1i", with: 2021)
click_button("Save and continue") click_button("Save and continue")
visit("/case-logs/#{id}") visit("/logs/#{id}")
click_link(text: "Tenancy information") click_link(text: "Tenancy information")
expect(page).to have_current_path("/case-logs/#{id}/tenancy-code") expect(page).to have_current_path("/case-logs/#{id}/tenancy-code")
end end

2
spec/models/form_handler_spec.rb

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

2
spec/requests/case_log_controller_spec.rb

@ -247,7 +247,7 @@ RSpec.describe CaseLogsController, type: :request do
FactoryBot.create( FactoryBot.create(
:case_log, :case_log,
:about_completed, :about_completed,
startdate: Time.zone.local(2022, 10, 10), startdate: Time.zone.local(2022, 10, 10),
owning_organisation: organisation, owning_organisation: organisation,
managing_organisation: organisation, managing_organisation: organisation,
) )

Loading…
Cancel
Save