Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-14196 | Set idv_consent_given_at timestamp #11164

Merged
merged 1 commit into from
Aug 29, 2024
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
1 change: 1 addition & 0 deletions app/controllers/idv/agreement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def update

if result.success?
idv_session.idv_consent_given = true
idv_session.idv_consent_given_at = Time.zone.now

if IdentityConfig.store.in_person_proofing_opt_in_enabled &&
IdentityConfig.store.in_person_proofing_enabled
Expand Down
1 change: 1 addition & 0 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Session
had_barcode_attention_error
had_barcode_read_failure
idv_consent_given
idv_consent_given_at
idv_phone_step_document_capture_session_uuid
mail_only_warning_shown
opted_in_to_in_person_proofing
Expand Down
13 changes: 13 additions & 0 deletions spec/controllers/idv/agreement_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@

expect(response).to redirect_to(idv_hybrid_handoff_url)
end

it 'sets an idv_consent_given_at timestamp' do
put :update, params: params

expect(subject.idv_session.idv_consent_given_at).to be_within(3.seconds).of(Time.zone.now)
end
end

context 'when both ipp and opt-in ipp are enabled' do
Expand Down Expand Up @@ -228,6 +234,13 @@
put :update, params: params
expect(response).to render_template('idv/agreement/show')
end

it 'does not set IDV consent flags' do
put :update, params: params

expect(subject.idv_session.idv_consent_given).to be_nil
expect(subject.idv_session.idv_consent_given_at).to be_nil
end
end
end
end