-
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 name and dob check to matching claims
A requirement is to trigger a "multiple claims with matching details" warning if there is another claim with a matching name and date of birth. This check is to work across all policies.
- Loading branch information
Showing
4 changed files
with
51 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
describe "#matching_claims for ECP/LUP claims" do | ||
let!(:source_claim) { | ||
create(:claim, | ||
first_name: "Genghis", | ||
surname: "Khan", | ||
date_of_birth: Date.new(1162, 5, 31), | ||
national_insurance_number: "QQ891011C", | ||
email_address: "[email protected]", | ||
bank_account_number: "34682151", | ||
|
@@ -17,6 +20,9 @@ | |
let!(:student_loans_claim) { | ||
create(:claim, | ||
:submitted, | ||
first_name: "Genghis", | ||
surname: "Khan", | ||
date_of_birth: Date.new(1162, 5, 31), | ||
national_insurance_number: "QQ891011C", | ||
email_address: "[email protected]", | ||
bank_account_number: "34682151", | ||
|
@@ -30,6 +36,9 @@ | |
let!(:lup_claim) { | ||
create(:claim, | ||
:submitted, | ||
first_name: "Genghis", | ||
surname: "Khan", | ||
date_of_birth: Date.new(1162, 5, 31), | ||
national_insurance_number: "QQ891011C", | ||
email_address: "[email protected]", | ||
bank_account_number: "34682151", | ||
|
@@ -50,6 +59,9 @@ | |
describe "#matching_claims" do | ||
let(:source_claim) { | ||
create(:claim, | ||
first_name: "Genghis", | ||
surname: "Khan", | ||
date_of_birth: Date.new(1162, 5, 31), | ||
national_insurance_number: "QQ891011C", | ||
email_address: "[email protected]", | ||
bank_account_number: "34682151", | ||
|
@@ -172,5 +184,38 @@ | |
|
||
expect(matching_claims).to be_empty | ||
end | ||
|
||
it "does not include a claim with a matching name" do | ||
create( | ||
:claim, | ||
:submitted, | ||
first_name: source_claim.first_name, | ||
surname: source_claim.surname | ||
) | ||
|
||
expect(matching_claims).to be_empty | ||
end | ||
|
||
it "does not include a claim with a matching date of birth" do | ||
create( | ||
:claim, | ||
:submitted, | ||
date_of_birth: source_claim.date_of_birth | ||
) | ||
|
||
expect(matching_claims).to be_empty | ||
end | ||
|
||
it "includes a claim with a matching name and date of birth" do | ||
claim_with_matching_attributes = create( | ||
:claim, | ||
:submitted, | ||
first_name: source_claim.first_name, | ||
surname: source_claim.surname, | ||
date_of_birth: source_claim.date_of_birth | ||
) | ||
|
||
expect(matching_claims).to eq([claim_with_matching_attributes]) | ||
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
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