|
|
|
@ -27,7 +27,7 @@ RSpec.describe CheckYourErrorsController, type: :request do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when user is signed in" do |
|
|
|
|
context "with multiple error fields" do |
|
|
|
|
context "with multiple error fields and answered questions" do |
|
|
|
|
before do |
|
|
|
|
sign_in user |
|
|
|
|
get "/lettings-logs/#{lettings_log.id}/check-your-errors?related_question_ids[]=startdate&related_question_ids[]=needstype&original_question_id=startdate" |
|
|
|
@ -39,6 +39,19 @@ RSpec.describe CheckYourErrorsController, type: :request do
|
|
|
|
|
expect(page).to have_link("Clear all", href: "/lettings-logs/#{lettings_log.id}/confirm-clear-all-answers?original_question_id=startdate&related_question_ids%5B%5D=startdate&related_question_ids%5B%5D=needstype") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with multiple error fields and unanswered questions" do |
|
|
|
|
before do |
|
|
|
|
lettings_log.update!(needstype: nil, startdate: nil) |
|
|
|
|
sign_in user |
|
|
|
|
get "/lettings-logs/#{lettings_log.id}/check-your-errors?related_question_ids[]=startdate&related_question_ids[]=needstype&original_question_id=startdate" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "displays correct clear links" do |
|
|
|
|
expect(page).to have_link("Answer", href: "/lettings-logs/#{lettings_log.id}/needs-type?original_question_id=startdate&referrer=check_your_errors&related_question_ids%5B%5D=startdate&related_question_ids%5B%5D=needstype") |
|
|
|
|
expect(page).to have_link("Answer", href: "/lettings-logs/#{lettings_log.id}/tenancy-start-date?original_question_id=startdate&referrer=check_your_errors&related_question_ids%5B%5D=startdate&related_question_ids%5B%5D=needstype") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|