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
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git@github.com:18F/identity-equifax-api-client-gem.git
revision: 979a3342a2d08ee6ea2c444b846e4e15d50a0891
revision: 4308a502baf7b65e8b463ecafc2d428d530b4349
branch: master
specs:
equifax (1.0.0)
Expand Down Expand Up @@ -228,7 +228,7 @@ GEM
rails (>= 3.1.1)
diff-lcs (1.3)
docile (1.1.5)
dotenv (2.2.0)
dotenv (2.2.1)
dotiw (3.1.1)
actionpack (>= 3)
i18n
Expand Down Expand Up @@ -298,7 +298,7 @@ GEM
httpi (2.4.2)
rack
socksify
i18n (0.8.1)
i18n (0.8.4)
i18n-tasks (0.9.15)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
Expand Down Expand Up @@ -351,7 +351,7 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
mini_portile2 (2.2.0)
minitest (5.10.2)
multi_json (1.12.1)
multi_xml (0.6.0)
Expand All @@ -360,8 +360,8 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
newrelic_rpm (4.1.0.333)
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
nori (2.6.0)
notiffany (0.1.1)
nenv (~> 0.1)
Expand Down
8 changes: 1 addition & 7 deletions app/services/idv/financials_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def submit
idv_session.financials_confirmation = false
end

FormResponse.new(success: success, errors: errors, extra: extra_analytics_attributes)
FormResponse.new(success: success, errors: errors)
end

def form_valid_but_vendor_validation_failed?
Expand All @@ -37,11 +37,5 @@ def vendor_params
finance_type = idv_form.finance_type
{ finance_type => idv_form.idv_params[finance_type] }
end

def extra_analytics_attributes
{
vendor: { reasons: vendor_reasons },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why take these out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Per the commit message: Remove extra analytics attributes for vendor reasons in the Financials and Phone steps because Equifax does not return any reasons for those verifications.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

}
end
end
end
6 changes: 1 addition & 5 deletions app/services/idv/phone_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def submit
idv_session.phone_confirmation = false
end

FormResponse.new(success: complete?, errors: errors, extra: extra_analytics_attributes)
FormResponse.new(success: complete?, errors: errors)
end

def form_valid_but_vendor_validation_failed?
Expand Down Expand Up @@ -37,9 +37,5 @@ def update_idv_session
idv_session.address_verification_mechanism = :phone
idv_session.params = idv_form.idv_params
end

def extra_analytics_attributes
{ vendor: { reasons: vendor_reasons } }
end
end
end
2 changes: 1 addition & 1 deletion app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def cache_encrypted_pii(password)
end

def vendor_params
applicant_params_ascii.merge(uuid: current_user.uuid)
applicant_params_ascii.merge('uuid' => current_user.uuid)
end

def profile
Expand Down
3 changes: 0 additions & 3 deletions spec/controllers/verify/finance_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
result = {
success: true,
errors: {},
vendor: { reasons: ['Good number'] },
}

expect(@analytics).to have_received(:track_event).with(
Expand All @@ -154,7 +153,6 @@
result = {
success: false,
errors: { ccn: ['The ccn could not be verified.'] },
vendor: { reasons: ['Bad number'] },
}

expect(@analytics).to have_received(:track_event).
Expand All @@ -171,7 +169,6 @@
result = {
success: false,
errors: { ccn: ['Credit card number should be only last 8 digits.'] },
vendor: { reasons: nil },
}

expect(@analytics).to have_received(:track_event).
Expand Down
4 changes: 1 addition & 3 deletions spec/controllers/verify/phone_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
errors: {
phone: [invalid_phone_message],
},
vendor: { reasons: nil },
}

expect(@analytics).to have_received(:track_event).with(
Expand All @@ -89,7 +88,7 @@

put :create, idv_phone_form: { phone: good_phone }

result = { success: true, errors: {}, vendor: { reasons: ['Good number'] } }
result = { success: true, errors: {} }

expect(@analytics).to have_received(:track_event).with(
Analytics::IDV_PHONE_CONFIRMATION, result
Expand All @@ -107,7 +106,6 @@
errors: {
phone: ['The phone number could not be verified.'],
},
vendor: { reasons: ['Bad number'] },
}

expect(flash[:warning]).to match t('idv.modal.phone.heading')
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/verify/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
it 'assigned user UUID to applicant' do
post :create, profile: user_attrs

expect(subject.idv_session.applicant[:uuid]).to eq subject.current_user.uuid
expect(subject.idv_session.applicant['uuid']).to eq subject.current_user.uuid
end
end

Expand Down
9 changes: 3 additions & 6 deletions spec/services/idv/financials_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def build_step(params)
describe '#submit' do
it 'returns FormResponse with success: false for invalid params' do
step = build_step(finance_type: :ccn, ccn: '1234')
extra = { vendor: { reasons: nil } }
errors = { ccn: [t('idv.errors.invalid_ccn')] }

response = instance_double(FormResponse)
Expand All @@ -29,13 +28,12 @@ def build_step(params)

expect(submission).to eq response
expect(FormResponse).to have_received(:new).
with(success: false, errors: errors, extra: extra)
with(success: false, errors: errors)
expect(idv_session.financials_confirmation).to eq false
end

it 'returns FormResponse with success: true for mock-happy CCN' do
step = build_step(finance_type: :ccn, ccn: '12345678')
extra = { vendor: { reasons: ['Good number'] } }

response = instance_double(FormResponse)
allow(FormResponse).to receive(:new).and_return(response)
Expand All @@ -44,15 +42,14 @@ def build_step(params)

expect(submission).to eq response
expect(FormResponse).to have_received(:new).
with(success: true, errors: {}, extra: extra)
with(success: true, errors: {})
expect(idv_session.financials_confirmation).to eq true
expect(idv_session.params).to eq idv_finance_form.idv_params
end

it 'returns FormResponse with success: false for mock-sad CCN' do
step = build_step(finance_type: :ccn, ccn: '00000000')

extra = { vendor: { reasons: ['Bad number'] } }
errors = { ccn: ['The ccn could not be verified.'] }

response = instance_double(FormResponse)
Expand All @@ -61,7 +58,7 @@ def build_step(params)

expect(submission).to eq response
expect(FormResponse).to have_received(:new).
with(success: false, errors: errors, extra: extra)
with(success: false, errors: errors)
expect(idv_session.financials_confirmation).to eq false
end
end
Expand Down
9 changes: 3 additions & 6 deletions spec/services/idv/phone_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ def build_step(params)
step = build_step(phone: '555')

errors = { phone: [invalid_phone_message] }
extra = { vendor: { reasons: nil } }

result = instance_double(FormResponse)

expect(FormResponse).to receive(:new).
with(success: false, errors: errors, extra: extra).and_return(result)
with(success: false, errors: errors).and_return(result)
expect(step.submit).to eq result
expect(idv_session.phone_confirmation).to eq false
end
Expand All @@ -39,9 +38,8 @@ def build_step(params)
step = build_step(phone: '555-555-0000')

result = instance_double(FormResponse)
extra = { vendor: { reasons: ['Good number'] } }

expect(FormResponse).to receive(:new).with(success: true, errors: {}, extra: extra).
expect(FormResponse).to receive(:new).with(success: true, errors: {}).
and_return(result)
expect(step.submit).to eq result
expect(idv_session.phone_confirmation).to eq true
Expand All @@ -52,12 +50,11 @@ def build_step(params)
step = build_step(phone: '555-555-5555')

errors = { phone: ['The phone number could not be verified.'] }
extra = { vendor: { reasons: ['Bad number'] } }

result = instance_double(FormResponse)

expect(FormResponse).to receive(:new).
with(success: false, errors: errors, extra: extra).and_return(result)
with(success: false, errors: errors).and_return(result)
expect(step.submit).to eq result
expect(idv_session.phone_confirmation).to eq false
end
Expand Down
2 changes: 1 addition & 1 deletion spec/services/idv/profile_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def build_step(params)
step.submit

expect(idv_session.params).to eq user_attrs
expect(idv_session.applicant).to eq user_attrs.merge(uuid: user.uuid)
expect(idv_session.applicant).to eq user_attrs.merge('uuid' => user.uuid)
end
end

Expand Down