|
|
|
@ -20,6 +20,16 @@ RSpec.describe "Form Page Routing" do |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "with 21/22 logs" do |
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
|
|
|
Timecop.freeze(Time.zone.local(2022, 1, 1)) do |
|
|
|
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
|
|
|
example.run |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
Timecop.return |
|
|
|
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "can route the user to a different page based on their answer on the current page", js: true do |
|
|
|
it "can route the user to a different page based on their answer on the current page", js: true do |
|
|
|
visit("/lettings-logs/#{id}/conditional-question") |
|
|
|
visit("/lettings-logs/#{id}/conditional-question") |
|
|
|
# using a question name that is already in the db to avoid |
|
|
|
# using a question name that is already in the db to avoid |
|
|
|
@ -111,6 +121,7 @@ RSpec.describe "Form Page Routing" do |
|
|
|
expect(find_field("lettings_log[startdate(1i)]").value).to eq(nil) |
|
|
|
expect(find_field("lettings_log[startdate(1i)]").value).to eq(nil) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when completing the setup section" do |
|
|
|
context "when completing the setup section" do |
|
|
|
context "with a supported housing log" do |
|
|
|
context "with a supported housing log" do |
|
|
|
|