-
Notifications
You must be signed in to change notification settings - Fork 166
Lg-14279 document request analytics event #11581
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
Changes from all commits
2b26d23
027a448
2a9f740
da5d954
fc8de06
23f4bc4
4e11f82
dd48c58
91e7033
e17d6b0
2791228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ | |
| and_return(socure_docv_verification_data_test_mode) | ||
| end | ||
|
|
||
| context 'happy path' do | ||
| context 'happy path', allow_browser_log: true do | ||
|
||
| before do | ||
| @pass_stub = stub_docv_verification_data_pass(docv_transaction_token: @docv_transaction_token) | ||
| end | ||
|
|
@@ -63,6 +63,9 @@ | |
| 'Rate Limit Reached', | ||
| limiter_type: :idv_doc_auth, | ||
| ) | ||
| expect(fake_analytics).to have_logged_event( | ||
| :idv_socure_document_request_submitted, | ||
| ) | ||
| end | ||
|
|
||
| context 'successfully processes image on last attempt' do | ||
|
|
@@ -88,7 +91,7 @@ | |
| end | ||
| end | ||
|
|
||
| context 'network connection errors' do | ||
| context 'network connection errors', allow_browser_log: true do | ||
| context 'getting the capture path' do | ||
| before do | ||
| allow_any_instance_of(Faraday::Connection).to receive(:post). | ||
|
|
@@ -103,6 +106,9 @@ | |
|
|
||
| expect(page).to have_content(t('doc_auth.headers.general.network_error')) | ||
| expect(page).to have_content(t('doc_auth.errors.general.new_network_error')) | ||
| expect(fake_analytics).to have_logged_event( | ||
| :idv_socure_document_request_submitted, | ||
| ) | ||
| end | ||
| end | ||
|
|
||
|
|
@@ -113,6 +119,22 @@ | |
| end | ||
| end | ||
|
|
||
| context 'invalid request', allow_browser_log: true do | ||
| context 'getting the capture path w wrong api key' do | ||
| before do | ||
| DocAuth::Mock::DocAuthMockClient.reset! | ||
| stub_docv_document_request(status: 401) | ||
| end | ||
|
|
||
| it 'correctly logs event', js: true do | ||
| visit idv_socure_document_capture_path | ||
| expect(fake_analytics).to have_logged_event( | ||
| :idv_socure_document_request_submitted, | ||
| ) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| it 'does not track state if state tracking is disabled' do | ||
| allow(IdentityConfig.store).to receive(:state_tracking_enabled).and_return(false) | ||
| socure_docv_upload_documents( | ||
|
|
@@ -203,6 +225,9 @@ | |
| expect(page).to have_current_path(idv_ssn_url) | ||
|
|
||
| expect(DocAuthLog.find_by(user_id: @user.id).state).to eq('NY') | ||
| expect(fake_analytics).to have_logged_event( | ||
| :idv_socure_document_request_submitted, | ||
| ) | ||
|
|
||
| fill_out_ssn_form_ok | ||
| click_idv_continue | ||
|
|
@@ -234,6 +259,9 @@ | |
|
|
||
| it 'shows the correct error page' do | ||
| expect(page).to have_content(t(expected_header_key)) | ||
| expect(fake_analytics).to have_logged_event( | ||
| :idv_socure_document_request_submitted, | ||
| ) | ||
| end | ||
| end | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.