Skip to content

Commit

Permalink
filtering awaiting_provider_verification
Browse files Browse the repository at this point in the history
- must now also be awaiting a decision
- this prevents approved and rejected claims when filtering for this
  • Loading branch information
asmega committed Oct 10, 2024
1 parent 5362b3a commit d594d82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/forms/admin/claims_filter_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def claims
when "failed_bank_validation"
Claim.includes(:decisions).failed_bank_validation.awaiting_decision
when "awaiting_provider_verification"
Claim.by_policy(Policies::FurtherEducationPayments).awaiting_further_education_provider_verification
Claim.by_policy(Policies::FurtherEducationPayments).awaiting_further_education_provider_verification.awaiting_decision
else
Claim.includes(:decisions).not_held.awaiting_decision.not_awaiting_further_education_provider_verification
end
Expand Down
25 changes: 25 additions & 0 deletions spec/forms/admin/claims_filter_form_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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
end
end

0 comments on commit d594d82

Please sign in to comment.