Skip to content

Commit

Permalink
change eligibility factory traits - new trait: not_verified
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 25, 2024
1 parent deb658b commit d7e54d8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
trait :eligible do
eligible_school
contract_type { "permanent" }
verified
end

trait :not_verified do
eligible_school
contract_type { "permanent" }
end

trait :eligible_school do
association :school, factory: :fe_eligible_school
end

trait :eligible_duplicate do
trait :duplicate do
flagged_as_duplicate { true }
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
eligibility_trait: :eligible
eligibility_trait: :not_verified
)
}
let!(:claim_with_trn) {
Expand All @@ -24,15 +24,15 @@
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
eligibility_trait: :eligible_duplicate
eligibility_trait: :duplicate
)
}
let!(:claim_with_duplicates_provider_email_sent) {
create(
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
eligibility_trait: :eligible_duplicate
eligibility_trait: :duplicate
)
}
let!(:verified_claim) {
Expand Down
12 changes: 6 additions & 6 deletions spec/models/claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,10 @@
describe ".awaiting_further_education_provider_verification" do
subject { described_class.awaiting_further_education_provider_verification }

let!(:claim_not_verified_provider_email_automatically_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible) }
let!(:claim_not_verified_provider_email_not_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible_duplicate) }
let!(:claim_not_verified_has_duplicates_provider_email_not_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible_duplicate) }
let!(:claim_not_verified_has_duplicates_provider_email_manually_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible_duplicate) }
let!(:claim_not_verified_provider_email_automatically_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :not_verified) }
let!(:claim_not_verified_provider_email_not_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :duplicate) }
let!(:claim_not_verified_has_duplicates_provider_email_not_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :duplicate) }
let!(:claim_not_verified_has_duplicates_provider_email_manually_sent) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :duplicate) }
let!(:claim_with_fe_provider_verification) { create(:claim, policy: Policies::FurtherEducationPayments, eligibility_trait: :verified) }
let!(:non_fe_claim) { create(:claim, policy: Policies::StudentLoans) }

Expand Down Expand Up @@ -1344,13 +1344,13 @@

context "when the eligiblity is not verified" do
context "when there are no duplicates" do
let(:claim) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible) }
let(:claim) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :not_verified) }

it { is_expected.to be true }
end

context "when there are duplicates" do
let(:claim) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :eligible_duplicate) }
let(:claim) { create(:claim, :submitted, policy: Policies::FurtherEducationPayments, eligibility_trait: :duplicate) }

context "the provider email has not been sent" do
it { is_expected.to be false }
Expand Down
6 changes: 1 addition & 5 deletions spec/support/admin_view_claim_feature_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
}

let!(:approved_awaiting_payroll_claim) {
eligibility = if policy == Policies::FurtherEducationPayments
create(:"#{policy.to_s.underscore}_eligibility", :verified)
else
create(:"#{policy.to_s.underscore}_eligibility", :eligible)
end
eligibility = create(:"#{policy.to_s.underscore}_eligibility", :eligible)
create(
:claim,
:payrollable,
Expand Down

0 comments on commit d7e54d8

Please sign in to comment.