Skip to content

Commit

Permalink
Display the note in the task a chaser email was sent
Browse files Browse the repository at this point in the history
  • Loading branch information
kenfodder committed Sep 23, 2024
1 parent 7047d19 commit 305bf50
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<% if @tasks_presenter.provider_verification.verification_email_sent? %>
<% if @tasks_presenter.provider_verification.verification_email_sent_by_admin_team? %>
<div class="govuk-inset-text">
<% @tasks_presenter.provider_verification.admin_sent_emails.each do |verification_email| %>
<% @tasks_presenter.provider_verification.admin_sent_emails.each do |verification_email|%>
<p>
The verification request was sent to the provider by
<%= user_details(verification_email.created_by) %> on <%= l(verification_email.created_at) %>
<% if verification_email.created_by %>
<%= user_details(verification_email.created_by) %>
<% else %>
an automated process
<% end %>
on <%= l(verification_email.created_at) %>
</p>
<% end %>
</div>
Expand Down
46 changes: 46 additions & 0 deletions spec/features/admin/admin_claim_further_education_payments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,52 @@

expect(claim.eligibility.reload.provider_verification_email_last_sent_at).to eq Time.now
end

it "shows the chaser verification email was sent if one was sent after 3 weeks" do
fe_provider = create(
:school,
:further_education,
:fe_eligible,
name: "Springfield A and M"
)

claim = create(
:claim,
first_name: "Edna",
surname: "Krabappel",
date_of_birth: Date.new(1945, 7, 3),
reference: "AB123456",
created_at: DateTime.new(2024, 8, 1, 9, 0, 0),
submitted_at: DateTime.new(2024, 8, 1, 9, 0, 0)
)

create(
:further_education_payments_eligibility,
contract_type: "fixed_term",
claim: claim,
school: fe_provider,
award_amount: 1500,
provider_verification_email_last_sent_at: DateTime.new(2024, 8, 1, 9, 0, 0)
)

perform_enqueued_jobs do
FurtherEducationPayments::ProviderVerificationChaseEmailJob.perform_now
end

visit admin_claim_path(claim)

click_on "View tasks"

click_on(
"Confirm the provider has responded and verified the claimant's " \
"information"
)

expect(page).to have_content(
"The verification request was sent to the provider by " \
"an automated process on 9 September 2024 11:00am"
)
end
end
end
end
Expand Down

0 comments on commit 305bf50

Please sign in to comment.