-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task if provider / claimant details match
If the claimant and provider have matching details (name or email) we want to raise an admin task for ops to check that the claimant isn't trying to approve their own claim.
- Loading branch information
Showing
8 changed files
with
208 additions
and
2 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<% content_for(:page_title) { page_title("Claim #{@claim.reference} provider details check for #{@claim.policy.short_name}") } %> | ||
|
||
<% content_for :back_link do %> | ||
<%= govuk_back_link href: admin_claim_tasks_path(@claim) %> | ||
<% end %> | ||
|
||
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %> | ||
|
||
<div class="govuk-grid-row"> | ||
<%= render claim_summary_view, claim: @claim, heading: "Subject check" %> | ||
|
||
<div class="govuk-grid-column-two-thirds"> | ||
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2> | ||
|
||
<%= render "admin/claims/answers", answers: @tasks_presenter.provider_details %> | ||
</div> | ||
|
||
<div class="govuk-grid-column-two-thirds"> | ||
<% if !@task.passed.nil? %> | ||
<%= render "task_outcome", task: @task %> | ||
<% else %> | ||
<%= render "form", task_name: "provider_details", claim: @claim %> | ||
<% end %> | ||
|
||
<%= render partial: "admin/task_pagination" %> | ||
</div> | ||
</div> |
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
98 changes: 98 additions & 0 deletions
98
spec/features/admin/admin_checks_further_education_payments_claim_spec.rb
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Admin checks a further education payments claim" do | ||
before do | ||
sign_in_as_service_operator | ||
end | ||
|
||
context "when the claim has a claimant and provider with the same name" do | ||
it "requires the admin to check for provider fraud" do | ||
claim = create( | ||
:claim, | ||
:submitted, | ||
first_name: "Walter", | ||
middle_name: "Seymour", | ||
surname: "Skinner", | ||
email_address: "[email protected]", | ||
policy: Policies::FurtherEducationPayments, | ||
eligibility_attributes: { | ||
verification: { | ||
verifier: { | ||
first_name: "Walter", | ||
last_name: "Skinner", | ||
email: "[email protected]" | ||
} | ||
} | ||
} | ||
) | ||
|
||
visit admin_claim_tasks_path(claim) | ||
|
||
expect(page).to have_content("Check the provider details") | ||
|
||
click_on "Check the provider details" | ||
|
||
expect(page).to have_content( | ||
"Is the claim still valid even though the claimant and provider have matching details?" | ||
) | ||
end | ||
end | ||
|
||
context "when the claim has a claimant and provider with the same email" do | ||
it "requires the admin to check for provider fraud" do | ||
claim = create( | ||
:claim, | ||
:submitted, | ||
first_name: "Armin", | ||
surname: "Tamzarian", | ||
email_address: "[email protected]", | ||
policy: Policies::FurtherEducationPayments, | ||
eligibility_attributes: { | ||
verification: { | ||
verifier: { | ||
first_name: "Walter", | ||
last_name: "Skinner", | ||
email: "[email protected]" | ||
} | ||
} | ||
} | ||
) | ||
|
||
visit admin_claim_tasks_path(claim) | ||
|
||
expect(page).to have_content("Check the provider details") | ||
|
||
click_on "Check the provider details" | ||
|
||
expect(page).to have_content( | ||
"Is the claim still valid even though the claimant and provider have matching details?" | ||
) | ||
end | ||
end | ||
|
||
context "when the claim has a claimant and provider with different details" do | ||
it "doesn't require the admin check for provider fraud" do | ||
claim = create( | ||
:claim, | ||
:submitted, | ||
first_name: "Edna", | ||
surname: "Krabappel", | ||
email_address: "[email protected]", | ||
policy: Policies::FurtherEducationPayments, | ||
eligibility_attributes: { | ||
verification: { | ||
verifier: { | ||
first_name: "Walter", | ||
last_name: "Skinner", | ||
email: "[email protected]" | ||
} | ||
} | ||
} | ||
) | ||
|
||
visit admin_claim_tasks_path(claim) | ||
|
||
expect(page).not_to have_content("Check the provider details") | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -8,11 +8,21 @@ | |
let(:teacher_reference_number) { "1234567" } | ||
let(:matching_claims) { Claim.none } | ||
let(:hmrc_bank_validation_succeeded) { true } | ||
let(:claimant_first_name) { "Edna" } | ||
let(:claimant_surname) { "Krabappel" } | ||
let(:claimant_email_address) { "[email protected]" } | ||
|
||
let(:eligibility) do | ||
build( | ||
:further_education_payments_eligibility, | ||
teacher_reference_number: teacher_reference_number | ||
teacher_reference_number: teacher_reference_number, | ||
verification: { | ||
verifier: { | ||
first_name: "Walter", | ||
last_name: "Skinner", | ||
email: "[email protected]" | ||
} | ||
} | ||
) | ||
end | ||
|
||
|
@@ -22,7 +32,10 @@ | |
policy: Policies::FurtherEducationPayments, | ||
payroll_gender: payroll_gender, | ||
hmrc_bank_validation_succeeded: hmrc_bank_validation_succeeded, | ||
eligibility: eligibility | ||
eligibility: eligibility, | ||
first_name: claimant_first_name, | ||
surname: claimant_surname, | ||
email_address: claimant_email_address | ||
) | ||
end | ||
|
||
|
@@ -83,5 +96,23 @@ | |
it { is_expected.not_to include("payroll_details") } | ||
it { is_expected.to include(*invariant_tasks) } | ||
end | ||
|
||
context "when the claimant and provider names match" do | ||
let(:claimant_first_name) { "Walter" } | ||
let(:claimant_surname) { "Skinner" } | ||
it { is_expected.to include("provider_details") } | ||
it { is_expected.to include(*invariant_tasks) } | ||
end | ||
|
||
context "when the claimant and provider emails match" do | ||
let(:claimant_email_address) { "[email protected]" } | ||
it { is_expected.to include("provider_details") } | ||
it { is_expected.to include(*invariant_tasks) } | ||
end | ||
|
||
context "when the claim and provider details are different" do | ||
it { is_expected.not_to include("provider_details") } | ||
it { is_expected.to include(*invariant_tasks) } | ||
end | ||
end | ||
end |