|
|
|
|
@ -532,6 +532,33 @@ RSpec.describe FormController, type: :request do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when the question was accessed from an interrution screen (soft validation)" do |
|
|
|
|
let(:params) do |
|
|
|
|
{ |
|
|
|
|
id: lettings_log.id, |
|
|
|
|
lettings_log: { |
|
|
|
|
page: page_id, |
|
|
|
|
age1: 20, |
|
|
|
|
interruption_page_id: "retirement_value_check", |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
post "/lettings-logs/#{lettings_log.id}/#{page_id.dasherize}?referrer=interruption_screen", params: |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "redirects back to the soft validation page" do |
|
|
|
|
expect(response).to redirect_to("/lettings-logs/#{lettings_log.id}/retirement-value-check") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "displays a success banner" do |
|
|
|
|
follow_redirect! |
|
|
|
|
follow_redirect! |
|
|
|
|
expect(response.body).to include("You have successfully updated lead tenant’s age") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with checkbox questions" do |
|
|
|
|
|