Skip to content

Commit

Permalink
feature spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 9, 2024
1 parent 13117fa commit e4f8b10
Show file tree
Hide file tree
Showing 2 changed files with 48 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,44 @@
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)")
expect(page).to have_content(claim.school.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_with_trn.eligibility.teacher_reference_number)
expect(page).to have_content("UK Provider Reference Number (UKPRN)")
expect(page).to have_content(claim_with_trn.school.ukprn)
end
end

0 comments on commit e4f8b10

Please sign in to comment.