-
Notifications
You must be signed in to change notification settings - Fork 166
Bugfix: Clear in_person_verification_pending_at on fraud deactivation #10222
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
a7bdcdd
53aff72
c9c3580
f4ff321
6c56cd5
7c67df3
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 |
|---|---|---|
|
|
@@ -1016,33 +1016,18 @@ | |
| # TODO: related: should we test against an active profile here? | ||
| describe '#deactivate_for_fraud_review' do | ||
| it 'sets fraud_review_pending to true and sets fraud_pending_reason' do | ||
| profile = create(:profile, user: user) | ||
|
|
||
| expect(profile.activated_at).to be_nil | ||
| expect(profile.active).to eq(false) # ??? | ||
| expect(profile.deactivation_reason).to be_nil | ||
| expect(profile.fraud_review_pending?).to eq(false) # to change | ||
| expect(profile.gpo_verification_pending_at).to be_nil | ||
| expect(profile.in_person_verification_pending_at).to be_nil | ||
| expect(profile.initiating_service_provider).to be_nil | ||
| expect(profile.verified_at).to be_nil | ||
| profile = create(:profile, :in_person_verification_pending, user: user) | ||
|
|
||
| profile.fraud_pending_reason = 'threatmetrix_review' | ||
| profile.deactivate_for_fraud_review | ||
|
|
||
| expect(profile.activated_at).to be_nil | ||
| expect(profile.active).to eq(false) | ||
| expect(profile.deactivation_reason).to be_nil | ||
| expect(profile.fraud_review_pending?).to eq(true) # changed | ||
| expect(profile.gpo_verification_pending_at).to be_nil | ||
| expect(profile.in_person_verification_pending_at).to be_nil | ||
| expect(profile.initiating_service_provider).to be_nil | ||
| expect(profile.verified_at).to be_nil | ||
| expect { profile.deactivate_for_fraud_review }.to( | ||
| change { profile.fraud_review_pending? }.from(false).to(true). | ||
| and(change { profile.in_person_verification_pending_at }.to(nil)), | ||
| ) | ||
|
|
||
| expect(profile).to_not be_active | ||
| expect(profile.fraud_review_pending?).to eq(true) | ||
| expect(profile.fraud_rejection?).to eq(false) | ||
| expect(profile.fraud_pending_reason).to eq('threatmetrix_review') | ||
| expect(profile.pending_reasons).to eq([:fraud_check_pending]) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting aside: this is what was previously returning The |
||
| end | ||
| end | ||
|
|
||
|
|
||
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.
It appears that this line has always been redundant; it was tested before and after above already.