Skip to content

Commit

Permalink
final changes made as per product review
Browse files Browse the repository at this point in the history
  • Loading branch information
syed87 committed Jun 18, 2024
1 parent 8e541e3 commit 7ae1a0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/mailers/teacher_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def further_information_received
end

def further_information_requested
@further_information_request = params[:further_information_request]

view_mail(
GOVUK_NOTIFY_TEMPLATE_ID,
to: teacher.email,
Expand Down
6 changes: 3 additions & 3 deletions app/services/request_further_information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def initialize(assessment:, user:)
def call
raise AlreadyExists if assessment.further_information_requests.exists?

create_and_request
send_email
send_email(create_and_request)
end

class AlreadyExists < StandardError
Expand Down Expand Up @@ -47,11 +46,12 @@ def create_and_request
end
end

def send_email
def send_email(further_information_request)
DeliverEmail.call(
application_form:,
mailer: TeacherMailer,
action: :further_information_requested,
further_information_request:,
)
end
end
4 changes: 2 additions & 2 deletions app/views/teacher_mailer/references_requested.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Dear <%= application_form_full_name(@application_form) %>,

We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application.

<% @reference_requests.contact_name.each do |contact_name| %>
<%= contact_name %>
<% @reference_requests.each do |reference_request| %>
<%= reference_request.contact_name %>
<% end %>

They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. If your references do not respond, and, as a result, we cannot verify your work history, we may not be able to award you QTS.
Expand Down
3 changes: 1 addition & 2 deletions spec/mailers/teacher_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
end

let(:further_information_request) do
create(:further_information_request, assessment:)
create(:further_information_request, :requested, assessment:)
end

describe "#subject" do
Expand Down Expand Up @@ -626,7 +626,6 @@
subject(:body) { mail.body }

it { is_expected.to include("Dear First Last") }
it { is_expected.to include("abc") }
it do
is_expected.to include(
"We’ve contacted the following references you provided to verify the work " \
Expand Down

0 comments on commit 7ae1a0e

Please sign in to comment.