Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/controllers/idv/agreement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def update
clear_future_steps!
skip_to_capture if params[:skip_hybrid_handoff]

result = Idv::ConsentForm.new.submit(consent_form_params)
@consent_form = Idv::ConsentForm.new(
idv_consent_given: idv_session.idv_consent_given,
)
result = @consent_form.submit(consent_form_params)

analytics.idv_doc_auth_agreement_submitted(
**analytics_arguments.merge(result.to_h),
Expand All @@ -42,7 +45,7 @@ def update
redirect_to idv_hybrid_handoff_url
end
else
redirect_to idv_agreement_url
render :show
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/idv/agreement_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@
}.compact
end

it 'redirects to idv agreement' do
it 'renders the form again' do
put :update, params: params
expect(response).to redirect_to(idv_agreement_url)
expect(response).to render_template('idv/agreement/show')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reasons I don't fully understand yet, response.body is an empty string here, so I'm only able to make this assertion, but not that it contains the error string that wasn't previously being displayed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controller specs don't render views by default, which may be causing what you're seeing. You can opt-in if you wanted to specifically assert against view content, though typically that'd happen in the view specs instead.

https://rspec.info/features/6-0/rspec-rails/controller-specs/render-views/

I think what you have here makes sense.

end
end
end
Expand Down