Skip to content

Commit

Permalink
feature spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 5, 2024
1 parent f6a2996 commit 89c58e0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,9 @@
}
end
end

trait :with_trn do
teacher_reference_number { generate(:teacher_reference_number) }
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
require "rails_helper"

RSpec.feature "Admin view claim for FurtherEducationPayments" do
let!(:journey_configuration) { create(:journey_configuration, "further_education_payments") }
let(:eligibility) { create(:further_education_payments_eligibility, :eligible) }
let(:eligibility_with_trn) { create(:further_education_payments_eligibility, :eligible, :with_trn) }
let!(:claim) {
create(
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
eligibility: eligibility
)
}
let!(:claim_with_trn) {
create(
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
eligibility: eligibility_with_trn
)
}

scenario "view claim summary for claim with no TRN" do
sign_in_as_service_operator
visit admin_claims_path
find("a[href='#{admin_claim_tasks_path(claim)}']").click
expect(page).not_to have_content("Claim route")
expect(page).not_to have_content("Not signed in with DfE Identity")
expect(page).to have_content("Not provided")
expect(page).to have_content("UK Provider Reference Number (UKPRN)")
end

scenario "view claim summary for claim with TRN" do
sign_in_as_service_operator
visit admin_claims_path
find("a[href='#{admin_claim_tasks_path(claim_with_trn)}']").click
expect(page).not_to have_content("Not provided")
expect(page).to have_content(claim.eligibility.teacher_reference_number)
expect(page).to have_content("UK Provider Reference Number (UKPRN)")
end
end

0 comments on commit 89c58e0

Please sign in to comment.