-
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 branch 'master' into LUPEYALPHA-1062-already-submitted-claim
- Loading branch information
Showing
12 changed files
with
182 additions
and
10 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
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,100 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Admin::ClaimsFilterForm, type: :model do | ||
describe "#claims" do | ||
context "when rejected whilst awaiting provider verification" do | ||
let!(:claim) do | ||
create( | ||
:claim, | ||
:rejected, | ||
:awaiting_provider_verification, | ||
policy: Policies::FurtherEducationPayments | ||
) | ||
end | ||
|
||
let(:session) { {} } | ||
let(:filters) { {status: "awaiting_provider_verification"} } | ||
|
||
subject { described_class.new(filters:, session:) } | ||
|
||
it "filtering by status awaiting provider verification excludes them" do | ||
expect(subject.claims).not_to include(claim) | ||
end | ||
end | ||
|
||
context "when the status is awaiting_provider_verification" do | ||
it "returns the expected claims" do | ||
claim_awaiting_provider_verification_1 = build( | ||
:claim, | ||
:submitted | ||
) | ||
|
||
create( | ||
:further_education_payments_eligibility, | ||
claim: claim_awaiting_provider_verification_1, | ||
flagged_as_duplicate: false | ||
) | ||
|
||
claim_awaiting_provider_verification_2 = build( | ||
:claim, | ||
:submitted | ||
) | ||
|
||
create( | ||
:further_education_payments_eligibility, | ||
claim: claim_awaiting_provider_verification_2, | ||
flagged_as_duplicate: true | ||
) | ||
|
||
create( | ||
:note, | ||
claim: claim_awaiting_provider_verification_2, | ||
label: "provider_verification" | ||
) | ||
|
||
create( | ||
:note, | ||
claim: claim_awaiting_provider_verification_2, | ||
label: "provider_verification" | ||
) | ||
|
||
_claim_not_awating_provider_verification = build(:claim, :submitted) | ||
|
||
create( | ||
:further_education_payments_eligibility, | ||
:verified | ||
) | ||
|
||
form = described_class.new( | ||
session: {}, | ||
filters: { | ||
status: "awaiting_provider_verification" | ||
} | ||
) | ||
|
||
expect(form.claims).to match_array( | ||
[ | ||
claim_awaiting_provider_verification_1, | ||
claim_awaiting_provider_verification_2 | ||
] | ||
) | ||
end | ||
end | ||
|
||
context "filtering for unassigned + auto approved claims" do | ||
subject { described_class.new(session:, filters: {team_member:, status:}) } | ||
|
||
let(:team_member) { "unassigned" } | ||
let(:status) { "automatically_approved" } | ||
let(:session) { {} } | ||
|
||
before do | ||
create(:claim, :submitted, :auto_approved, :current_academic_year) | ||
end | ||
|
||
it "works" do | ||
expect(subject.claims.count).to eql(1) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Policies::FurtherEducationPayments, type: :model do | ||
it { is_expected.to include(BasePolicy) } | ||
|
||
it do | ||
expect(subject::VERIFIERS).to eq([ | ||
AutomatedChecks::ClaimVerifiers::Identity, | ||
AutomatedChecks::ClaimVerifiers::ProviderVerification, | ||
AutomatedChecks::ClaimVerifiers::Employment, | ||
AutomatedChecks::ClaimVerifiers::StudentLoanPlan | ||
]) | ||
end | ||
|
||
specify { | ||
expect(subject).to have_attributes( | ||
notify_reply_to_id: "89939786-7078-4267-b197-ee505dfad8ae" | ||
) | ||
} | ||
end |
15 changes: 15 additions & 0 deletions
15
spec/models/policies/further_education_payments/admin_tasks_presenter_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,15 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Policies::FurtherEducationPayments::AdminTasksPresenter do | ||
describe "#employment" do | ||
let(:claim) { create(:claim, :submitted) } | ||
|
||
subject { described_class.new(claim) } | ||
|
||
it "displays answer with link" do | ||
expect(subject.employment[0][0]).to eql("Current provider") | ||
expect(subject.employment[0][1]).to include("href") | ||
expect(subject.employment[0][1]).to include(claim.school.dfe_number) | ||
end | ||
end | ||
end |