-
Notifications
You must be signed in to change notification settings - Fork 166
LG-11695 DocumentCapture submit requires selfie check #9873
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
Merged
soniaconnolly
merged 8 commits into
main
from
sonia-lg-11695-document-capture-submit-requires-selfie-check
Jan 12, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6a201dd
Update decorated_sp_session.selfie_required? to use FeatureManaagemen…
soniaconnolly 5923730
Confirm selfie check was done if needed before leaving DocumentCaptur…
soniaconnolly 8bc3647
Fix document capture feature spec
soniaconnolly e96d92d
Try making document_capture spec pass on CI this way
soniaconnolly db4fe43
Merge remote-tracking branch 'origin/main' into sonia-lg-11695-docume…
soniaconnolly cf74cb3
Rename confirm_selfie_performed_if_needed to selfie_requirement_met?
soniaconnolly c73ede3
Remove stray comments and use instance_doubles instead of plain doubles
soniaconnolly 224d601
Merge remote-tracking branch 'origin/main' into sonia-lg-11695-docume…
soniaconnolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
spec/controllers/concerns/idv/document_capture_concern_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| require 'rails_helper' | ||
|
|
||
| RSpec.describe Idv::DocumentCaptureConcern, :controller do | ||
| idv_document_capture_controller_class = Class.new(ApplicationController) do | ||
| def self.name | ||
| 'AnonymousController' | ||
| end | ||
|
|
||
| include Idv::DocumentCaptureConcern | ||
|
|
||
| def show | ||
| render plain: 'Hello' | ||
| end | ||
| end | ||
|
|
||
| describe '#selfie_requirement_met?' do | ||
| controller(idv_document_capture_controller_class) do | ||
| end | ||
|
|
||
| context 'selfie checks enabled' do | ||
| before do | ||
| decorated_sp_session = instance_double(ServiceProviderSession) | ||
| allow(decorated_sp_session).to receive(:selfie_required?).and_return(selfie_required) | ||
| allow(controller).to receive(:decorated_sp_session).and_return(decorated_sp_session) | ||
| stored_result = instance_double(DocumentCaptureSessionResult) | ||
| allow(stored_result).to receive(:selfie_check_performed).and_return(selfie_check_performed) | ||
| allow(controller).to receive(:stored_result).and_return(stored_result) | ||
| end | ||
|
|
||
| context 'SP requires biometric_comparison' do | ||
| let(:selfie_required) { true } | ||
|
|
||
| context 'selfie check performed' do | ||
| let(:selfie_check_performed) { true } | ||
| it 'returns true' do | ||
| expect(controller.selfie_requirement_met?).to eq(true) | ||
| end | ||
| end | ||
|
|
||
| context 'selfie check not performed' do | ||
| let(:selfie_check_performed) { false } | ||
| it 'returns false' do | ||
| expect(controller.selfie_requirement_met?).to eq(false) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'SP does not require biometric_comparison' do | ||
| let(:selfie_required) { false } | ||
|
|
||
| context 'selfie check performed' do | ||
| let(:selfie_check_performed) { true } | ||
| it 'returns true' do | ||
| expect(controller.selfie_requirement_met?).to eq(true) | ||
| end | ||
| end | ||
|
|
||
| context 'selfie check not performed' do | ||
| let(:selfie_check_performed) { false } | ||
| it 'returns true' do | ||
| expect(controller.selfie_requirement_met?).to eq(true) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmhooper Sonia and I tested this change and then also tested in
main. We saw the expected behavior in both places (could not continue past the doc auth page without a selfie if the requirements were changed partway through). Do you have any advice on if there's something we're missing that's needed here? Or maybe these changes aren't needed?(Putting the comment here so that the conversation can be chained / followed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slack discussion here. The conclusion is that controller tests are sufficient for this.