-
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.
Merge pull request #3232 from DFE-Digital/LUPEYALPHA-1108/fix-matchin…
…g-claims-ui Fixes admin matching claims ui
- Loading branch information
Showing
6 changed files
with
75 additions
and
66 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 |
---|---|---|
|
@@ -172,41 +172,6 @@ | |
end | ||
end | ||
|
||
describe "#matching_attributes" do | ||
let(:first_claim) { | ||
build( | ||
:claim, | ||
national_insurance_number: "QQ891011C", | ||
email_address: "[email protected]", | ||
bank_account_number: "34682151", | ||
bank_sort_code: "972654", | ||
building_society_roll_number: "123456789/ABCD", | ||
eligibility_attributes: {teacher_reference_number: "0902344"} | ||
) | ||
} | ||
let(:second_claim) { | ||
build( | ||
:claim, | ||
:submitted, | ||
national_insurance_number: first_claim.national_insurance_number, | ||
bank_account_number: first_claim.bank_account_number, | ||
bank_sort_code: first_claim.bank_sort_code, | ||
building_society_roll_number: first_claim.building_society_roll_number, | ||
eligibility_attributes: {teacher_reference_number: first_claim.eligibility.teacher_reference_number} | ||
) | ||
} | ||
subject { helper.matching_attributes(first_claim, second_claim) } | ||
|
||
it "returns the humanised names of the matching attributes" do | ||
expect(subject).to eq(["Bank account number", "Bank sort code", "Building society roll number", "National insurance number", "Teacher reference number"]) | ||
end | ||
|
||
it "does not consider a blank building society roll number to be a match" do | ||
[first_claim, second_claim].each { |claim| claim.building_society_roll_number = "" } | ||
expect(subject).to eq(["Bank account number", "Bank sort code", "National insurance number", "Teacher reference number"]) | ||
end | ||
end | ||
|
||
describe "#identity_confirmation_task_claim_verifier_match_status_tag" do | ||
subject(:identity_confirmation_task_claim_verifier_match_status_tag) { helper.identity_confirmation_task_claim_verifier_match_status_tag(claim) } | ||
|
||
|
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 |
---|---|---|
|
@@ -261,4 +261,36 @@ | |
|
||
it { is_expected.to eq [other_claim] } | ||
end | ||
|
||
describe "#matching_attributes" do | ||
it "returns the attributes that match" do | ||
source_claim = create( | ||
:claim, | ||
email_address: "[email protected]", | ||
national_insurance_number: "QQ891011C", | ||
bank_account_number: "34682151", | ||
bank_sort_code: "972654", | ||
eligibility_attributes: { | ||
teacher_reference_number: "0902344" | ||
} | ||
) | ||
|
||
other_claim = create( | ||
:claim, | ||
email_address: "[email protected]", | ||
national_insurance_number: "QQ891011C", | ||
bank_account_number: "11111111", | ||
bank_sort_code: "972654", | ||
eligibility_attributes: { | ||
teacher_reference_number: "0902344" | ||
} | ||
) | ||
|
||
expect( | ||
described_class.new(source_claim).matching_attributes(other_claim) | ||
).to eq( | ||
%w[email_address national_insurance_number teacher_reference_number] | ||
) | ||
end | ||
end | ||
end |