-
Notifications
You must be signed in to change notification settings - Fork 17
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
[DPC-4299] - Update AO job so sanctions don't affect org API access #2280
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
acb5c1a
don't call .update! on Provider Organization for AO not having waiver
lukey-luke 408c63e
update a couple test cases based on updates to verify_ao_job
lukey-luke c0822ad
don't expect audits of ProviderOrganization.verification_status is no…
lukey-luke f1ee605
rubocop linting
lukey-luke 65933f7
update rspec file based on review comments
lukey-luke 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 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 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 |
---|---|---|
|
@@ -179,7 +179,8 @@ def expect_audits(link, also: []) | |
links << create(:ao_org_link, last_checked_at: (n + 4).days.ago, user:, provider_organization:) | ||
end | ||
end | ||
it "should update user and all user's orgs and links" do | ||
# @@@ | ||
it 'should update user, but not impact ProviderOrganization.verification_status' do | ||
expect(AoOrgLink.where(last_checked_at: ..6.days.ago).count).to eq 1 | ||
VerifyAoJob.perform_now | ||
links.each do |link| | ||
|
@@ -188,8 +189,7 @@ def expect_audits(link, also: []) | |
expect(link.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.user.verification_status).to eq 'rejected' | ||
expect(link.user.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.provider_organization.verification_status).to eq 'rejected' | ||
expect(link.provider_organization.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.provider_organization.verification_status).to eq 'approved' | ||
end | ||
end | ||
it 'should log user check failed' do | ||
|
@@ -198,11 +198,8 @@ def expect_audits(link, also: []) | |
expect_log_for(link, 'ao_med_sanctions') | ||
end | ||
VerifyAoJob.perform_now | ||
links.each do |link| | ||
expect_audits(link, also: %i[user org]) | ||
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. I don't have all the context here, but should this still check the link and user audits, ie just remove |
||
end | ||
end | ||
it 'should not update former org/link' do | ||
it 'neither former nor current org link updated when ao verification status rejected' do | ||
user = create(:user, pac_id: '900666666', verification_status: :approved) | ||
provider_organization = create(:provider_organization, verification_status: :approved) | ||
link = create(:ao_org_link, last_checked_at: 8.days.ago, user:, provider_organization:) | ||
|
@@ -216,8 +213,8 @@ def expect_audits(link, also: []) | |
expect(link.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.user.verification_status).to eq 'rejected' | ||
expect(link.user.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.provider_organization.verification_status).to eq 'rejected' | ||
expect(link.provider_organization.verification_reason).to eq 'ao_med_sanctions' | ||
expect(link.provider_organization.verification_status).to eq 'approved' | ||
expect(link.provider_organization.verification_reason).to be nil | ||
expect(link.verification_status).to be false | ||
former_link.reload | ||
expect(former_link.verification_reason).to eq 'user_not_authorized_official' | ||
|
Oops, something went wrong.
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.