From 0524252ffefe19459793746acc44485ac9b5fbf6 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Thu, 9 Nov 2023 13:44:55 +0000 Subject: [PATCH 1/3] Update reference number content This changes the content we show for the reference number in various views as requested by our content designers. --- app/views/shared/teacher_mailer/_reference_number.text.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/shared/teacher_mailer/_reference_number.text.erb b/app/views/shared/teacher_mailer/_reference_number.text.erb index 4cb53aea02..76407a1c0e 100644 --- a/app/views/shared/teacher_mailer/_reference_number.text.erb +++ b/app/views/shared/teacher_mailer/_reference_number.text.erb @@ -1,3 +1 @@ -Your application reference number is: - -<%= @application_form.reference %> +Application reference number: <%= @application_form.reference %> From b7c21f96a604b9817f3bc5373f160ebcb5bab87b Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Thu, 9 Nov 2023 15:33:39 +0000 Subject: [PATCH 2/3] Refactor ApplicationFormViewObject I've renamed it and combined the decline reason methods together so we can use them in the views and in the mailers. --- .../application_forms_controller.rb | 14 +- ...ect.rb => application_form_view_object.rb} | 153 +++++++------ .../application_forms/show/_declined.html.erb | 35 +-- config/initializers/date_formats.rb | 4 +- ...b => application_form_view_object_spec.rb} | 205 ++++++++---------- .../application_forms_show_spec.rb | 6 +- 6 files changed, 202 insertions(+), 215 deletions(-) rename app/view_objects/teacher_interface/{application_form_show_view_object.rb => application_form_view_object.rb} (56%) rename spec/view_objects/teacher_interface/{application_form_show_view_object_spec.rb => application_form_view_object_spec.rb} (64%) diff --git a/app/controllers/teacher_interface/application_forms_controller.rb b/app/controllers/teacher_interface/application_forms_controller.rb index beb80c660d..794f797152 100644 --- a/app/controllers/teacher_interface/application_forms_controller.rb +++ b/app/controllers/teacher_interface/application_forms_controller.rb @@ -13,7 +13,7 @@ class ApplicationFormsController < BaseController define_history_check :edit def new - existing_application_form = current_teacher.application_form + existing_application_form = application_form @already_applied = existing_application_form.present? @needs_region = false @@ -26,7 +26,7 @@ def new end def create - @already_applied = current_teacher.application_form.present? + @already_applied = application_form.present? @country_region_form = CountryRegionForm.new( @@ -44,15 +44,15 @@ def create end def show - @view_object = ApplicationFormShowViewObject.new(current_teacher:) - - if @view_object.application_form.nil? + if application_form.nil? redirect_to %i[new teacher_interface application_form] end + + @view_object = ApplicationFormViewObject.new(application_form:) end def edit - @view_object = ApplicationFormShowViewObject.new(current_teacher:) + @view_object = ApplicationFormViewObject.new(application_form:) @sanction_confirmation_form = SanctionConfirmationForm.new( @@ -62,7 +62,7 @@ def edit end def update - @view_object = ApplicationFormShowViewObject.new(current_teacher:) + @view_object = ApplicationFormViewObject.new(application_form:) if ( @sanction_confirmation_form = diff --git a/app/view_objects/teacher_interface/application_form_show_view_object.rb b/app/view_objects/teacher_interface/application_form_view_object.rb similarity index 56% rename from app/view_objects/teacher_interface/application_form_show_view_object.rb rename to app/view_objects/teacher_interface/application_form_view_object.rb index 28006d89fa..1757c383e0 100644 --- a/app/view_objects/teacher_interface/application_form_show_view_object.rb +++ b/app/view_objects/teacher_interface/application_form_view_object.rb @@ -1,43 +1,31 @@ # frozen_string_literal: true -class TeacherInterface::ApplicationFormShowViewObject +class TeacherInterface::ApplicationFormViewObject include RegionHelper - def initialize(current_teacher:) - @current_teacher = current_teacher + def initialize(application_form:) + @application_form = application_form end - def teacher - @current_teacher - end - - def application_form - @application_form ||= teacher.application_form - end + attr_reader :application_form - def assessment - @assessment ||= application_form&.assessment - end + delegate :assessment, :region, :teacher, to: :application_form def further_information_request @further_information_request ||= assessment&.further_information_requests&.first end - def professional_standing_request - @professional_standing_request ||= assessment&.professional_standing_request - end - def started_at - application_form.created_at.strftime("%e %B %Y") + application_form.created_at.to_fs(:date).strip end def expires_at - (application_form.created_at + 6.months).strftime("%e %B %Y") + application_form.expires_at.to_fs(:date).strip end def task_list_sections - @task_list_sections ||= [ + [ task_list_section( :about_you, %i[personal_information identification_document], @@ -62,40 +50,46 @@ def task_list_sections end def completed_task_list_sections - @completed_task_list_sections ||= - task_list_sections.filter do |section| - section[:items].all? { |item| item[:status] == "completed" } - end + task_list_sections.filter do |section| + section[:items].all? { |item| item[:status] == "completed" } + end end def can_submit? completed_task_list_sections.count == task_list_sections.count end - def notes_from_assessors - return [] if assessment.nil? || further_information_request.present? - - assessment.sections.filter_map do |section| - next nil if section.selected_failure_reasons.empty? - - failure_reasons = - section.selected_failure_reasons.map do |failure_reason| - is_decline = - FailureReasons.decline?(failure_reason: failure_reason.key) + def declined_reasons + if further_information_request&.expired? + { + "" => [ + I18n.t( + "teacher_interface.application_forms.show.declined.failure_reasons.further_information_request_expired", + ), + ], + } + elsif professional_standing_request&.expired? + { + "" => [ + I18n.t( + "teacher_interface.application_forms.show.declined.failure_reasons.professional_standing_request_expired", + certificate_name: region_certificate_name(region), + teaching_authority_name: region_teaching_authority_name(region), + ), + ], + } + else + reasons = {} - { - key: failure_reason.key, - is_decline:, - assessor_feedback: failure_reason.assessor_feedback, - } - end + if (note = assessment&.recommendation_assessor_note).present? + reasons.merge!({ "" => [note] }) + end - failure_reasons = - failure_reasons.sort_by do |failure_reason| - [failure_reason[:is_decline] ? 0 : 1, failure_reason[:key]] - end + if assessment.present? && further_information_request.nil? + reasons.merge!(assessment_declined_reasons) + end - { assessment_section_key: section.key, failure_reasons: } + reasons end end @@ -111,14 +105,6 @@ def declined_cannot_reapply? end end - def show_further_information_request_expired_content? - further_information_request&.expired? || false - end - - def show_professional_standing_request_expired_content? - professional_standing_request&.expired? || false - end - def request_further_information? further_information_request.present? && further_information_request.requested? && @@ -134,8 +120,6 @@ def request_professional_standing_certificate? ) || false end - delegate :region, to: :application_form - private delegate :needs_work_history, @@ -143,8 +127,9 @@ def request_professional_standing_certificate? :needs_registration_number, :teaching_authority_provides_written_statement, :requires_preliminary_check, - to: :application_form, - allow_nil: true + to: :application_form + + delegate :professional_standing_request, to: :assessment, allow_nil: true def task_list_section(key, item_keys) { @@ -156,14 +141,14 @@ def task_list_section(key, item_keys) def task_list_items(keys) keys.map do |key| { - name: name_for_task_item(key), - link: link_for_task_item(key), - status: status_for_task_item(key), + name: task_list_item_name(key), + link: task_list_item_link(key), + status: task_list_item_status(key), } end end - def name_for_task_item(key) + def task_list_item_name(key) if key == :written_statement if application_form.teaching_authority_provides_written_statement I18n.t("application_form.tasks.items.written_statement.provide") @@ -175,7 +160,7 @@ def name_for_task_item(key) end end - def link_for_task_item(key) + def task_list_item_link(key) case key when :identification_document [ @@ -205,7 +190,49 @@ def link_for_task_item(key) end end - def status_for_task_item(key) + def task_list_item_status(key) application_form.send("#{key}_status") end + + def assessment_declined_reasons + assessment + .sections + .each_with_object({}) do |section, hash| + next if section.selected_failure_reasons.empty? + + sorted_reasons = + section.selected_failure_reasons.sort_by do |failure_reason| + is_decline = + FailureReasons.decline?(failure_reason: failure_reason.key) + + [is_decline ? 0 : 1, failure_reason.key] + end + + reasons = + sorted_reasons.map do |failure_reason| + title = + I18n.t( + failure_reason.key, + scope: %i[ + teacher_interface + application_forms + show + declined + failure_reasons + ], + ) + + if ( + assessor_feedback = failure_reason.assessor_feedback + ).present? && + FailureReasons.decline?(failure_reason: failure_reason.key) + "#{title}\n\n#{assessor_feedback}" + else + title + end + end + + hash[section.key.humanize] = reasons + end + end end diff --git a/app/views/teacher_interface/application_forms/show/_declined.html.erb b/app/views/teacher_interface/application_forms/show/_declined.html.erb index 30c644dae0..148e68a92e 100644 --- a/app/views/teacher_interface/application_forms/show/_declined.html.erb +++ b/app/views/teacher_interface/application_forms/show/_declined.html.erb @@ -2,41 +2,20 @@

Why your application was declined

-<% if view_object.show_further_information_request_expired_content? %> - <%= govuk_inset_text(text: t(".failure_reasons.further_information_request_expired")) %> -<% end %> - -<% if view_object.show_professional_standing_request_expired_content? %> - <%= govuk_inset_text(text: t( - ".failure_reasons.professional_standing_request_expired", - certificate_name: region_certificate_name(view_object.region), - teaching_authority_name: region_teaching_authority_name(view_object.region) - )) %> -<% end %> +<% if (declined_reasons = view_object.declined_reasons).present? %> + <% declined_reasons.each do |title, reasons| %> + <% if title.present? %> +

<%= title %>

+ <% end %> -<% if (sections = view_object.notes_from_assessors).present? %> -

Notes from the assessor:

- - <% sections.each do |section| %> -
<%= section[:assessment_section_key].humanize %>
<% end %> <% end %> -<% if (recommendation_assessor_note = view_object.assessment.recommendation_assessor_note).present? %> - <%= govuk_inset_text { simple_format recommendation_assessor_note } %> -<% end %> - <% unless view_object.declined_cannot_reapply? %>

What you can do next

diff --git a/config/initializers/date_formats.rb b/config/initializers/date_formats.rb index c90e54bce3..dd0115523e 100644 --- a/config/initializers/date_formats.rb +++ b/config/initializers/date_formats.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Date::DATE_FORMATS[:long_ordinal_uk] = "%-d %B %Y" +Date::DATE_FORMATS[:month_and_year] = "%B %Y" +Time::DATE_FORMATS[:date] = "%e %B %Y" Time::DATE_FORMATS[:date_and_time] = "%e %B %Y at %l:%M %P" - -Date::DATE_FORMATS[:month_and_year] = "%B %Y" diff --git a/spec/view_objects/teacher_interface/application_form_show_view_object_spec.rb b/spec/view_objects/teacher_interface/application_form_view_object_spec.rb similarity index 64% rename from spec/view_objects/teacher_interface/application_form_show_view_object_spec.rb rename to spec/view_objects/teacher_interface/application_form_view_object_spec.rb index 571e47e8ae..95d90ab7b2 100644 --- a/spec/view_objects/teacher_interface/application_form_show_view_object_spec.rb +++ b/spec/view_objects/teacher_interface/application_form_view_object_spec.rb @@ -2,22 +2,10 @@ require "rails_helper" -RSpec.describe TeacherInterface::ApplicationFormShowViewObject do - subject(:view_object) { described_class.new(current_teacher:) } +RSpec.describe TeacherInterface::ApplicationFormViewObject do + subject(:view_object) { described_class.new(application_form:) } - let(:current_teacher) { create(:teacher) } - - describe "#application_form" do - subject(:application_form) { view_object.application_form } - - it { is_expected.to be_nil } - - context "with an application form" do - before { create(:application_form, teacher: current_teacher) } - - it { is_expected.to_not be_nil } - end - end + let(:application_form) { create(:application_form) } describe "#assessment" do subject(:assessment) { view_object.assessment } @@ -25,10 +13,7 @@ it { is_expected.to be_nil } context "with an assessment form" do - before do - application_form = create(:application_form, teacher: current_teacher) - create(:assessment, application_form:) - end + before { create(:assessment, application_form:) } it { is_expected.to_not be_nil } end @@ -43,7 +28,6 @@ context "with an application form" do before do - application_form = create(:application_form, teacher: current_teacher) assessment = create(:assessment, application_form:) create(:further_information_request, assessment:) end @@ -52,6 +36,26 @@ end end + describe "#started_at" do + subject(:started_at) { view_object.started_at } + + let(:application_form) do + create(:application_form, created_at: Date.new(2020, 1, 1)) + end + + it { is_expected.to eq("1 January 2020") } + end + + describe "#expires_at" do + subject(:expires_at) { view_object.expires_at } + + let(:application_form) do + create(:application_form, created_at: Date.new(2020, 1, 1)) + end + + it { is_expected.to eq("1 July 2020") } + end + describe "#task_list_sections" do subject(:task_list_sections) { view_object.task_list_sections } @@ -59,10 +63,9 @@ let(:needs_written_statement) { false } let(:needs_registration_number) { false } - before do + let(:application_form) do create( :application_form, - teacher: current_teacher, needs_work_history:, needs_written_statement:, needs_registration_number:, @@ -167,10 +170,6 @@ view_object.completed_task_list_sections end - let!(:application_form) do - create(:application_form, teacher: current_teacher) - end - context "without any completed sections" do it { is_expected.to be_empty } end @@ -191,111 +190,93 @@ subject(:can_submit?) { view_object.can_submit? } context "without any completed sections" do - before { create(:application_form, teacher: current_teacher) } - it { is_expected.to be false } end context "with a completed application form" do - before { create(:application_form, :completed, teacher: current_teacher) } + let(:application_form) { create(:application_form, :completed) } it { is_expected.to be true } end end - describe "#notes_from_assessors" do - subject(:notes_from_assessors) { view_object.notes_from_assessors } + describe "#declined_reasons" do + subject(:declined_reasons) { view_object.declined_reasons } it { is_expected.to be_empty } - context "with failure reasons" do - let(:application_form) do - create(:application_form, teacher: current_teacher) - end - let(:assessment) { create(:assessment, application_form:) } - let(:assessment_section) do - create(:assessment_section, :personal_information, :failed, assessment:) - end - let!(:failure_reasons) { assessment_section.selected_failure_reasons } + let(:assessment) { create(:assessment, application_form:) } + context "when further_information_request is present and expired" do + before { create(:further_information_request, :expired, assessment:) } it do is_expected.to eq( - [ - { - assessment_section_key: "personal_information", - failure_reasons: - failure_reasons.map do |failure_reason| - { - assessor_feedback: failure_reason.assessor_feedback, - is_decline: false, - key: failure_reason.key, - } - end, - }, - ], + { + "" => [ + "Your application has been declined as you did not respond to the " \ + "assessor’s request for further information within the specified time.", + ], + }, ) end end - end - - describe "#show_further_information_request_expired_content?" do - let(:application_form) do - create(:application_form, teacher: current_teacher) - end - let(:assessment) { create(:assessment, application_form:) } - - subject(:show_fi_expired) do - view_object.show_further_information_request_expired_content? - end - - context "when further_information_request is present" do - context "and it has expired" do - let!(:further_information_request) do - create(:further_information_request, :expired, assessment:) - end - it { is_expected.to eq(true) } - end - context "and it hasn't expired" do - let!(:further_information_request) do - create(:further_information_request, assessment:) - end - it { is_expected.to eq(false) } + context "when professional_standing_request is present and expired" do + before { create(:professional_standing_request, :expired, assessment:) } + it do + is_expected.to eq( + { + "" => [ + "Your application has been declined as we did not receive your letter " \ + "that proves you’re recognised as a teacher from teaching authority " \ + "within 180 days.", + ], + }, + ) end end - context "when further_information_request is nil" do - it { is_expected.to eq(false) } + context "with a recommendation note" do + before { assessment.update!(recommendation_assessor_note: "A note.") } + it { is_expected.to eq({ "" => ["A note."] }) } end - end - describe "#show_professional_standing_request_expired_content?" do - let(:application_form) do - create(:application_form, teacher: current_teacher) - end - let(:assessment) { create(:assessment, application_form:) } - - subject { view_object.show_professional_standing_request_expired_content? } - - context "when professional_standing_request is present" do - context "and it has expired" do - let!(:professional_standing_request) do - create(:professional_standing_request, :expired, assessment:) - end - it { is_expected.to eq(true) } + context "with failure reasons" do + let(:assessment_section) do + create( + :assessment_section, + :personal_information, + :failed, + assessment:, + selected_failure_reasons: [ + build( + :selected_failure_reason, + key: FailureReasons::QUALIFIED_TO_TEACH, + assessor_feedback: "A note.", + ), + build( + :selected_failure_reason, + key: FailureReasons::AGE_RANGE, + assessor_feedback: "A note.", + ), + ], + ) end + let!(:failure_reasons) { assessment_section.selected_failure_reasons } - context "and it hasn't expired" do - let!(:professional_standing_request) do - create(:professional_standing_request, assessment:) - end - it { is_expected.to eq(false) } + it do + is_expected.to eq( + { + "Personal information" => [ + "The age range you are qualified to teach does not fall " \ + "within the requirements of QTS.\n\nA note.", + "We were not provided with sufficient evidence to confirm " \ + "qualification to teach at state or government schools.", + ], + }, + ) end end - - context "when professional_standing_request is nil" do - it { is_expected.to eq(false) } - end end describe "#declined_cannot_reapply?" do @@ -304,9 +285,6 @@ it { is_expected.to be false } context "with failure reasons" do - let(:application_form) do - create(:application_form, teacher: current_teacher) - end let(:assessment) { create(:assessment, application_form:) } context "with sanctions" do @@ -338,27 +316,32 @@ end describe "#request_professional_standing_certificate?" do - let(:assessment) { create(:assessment) } - subject(:request_professional_standing_certificate?) do view_object.request_professional_standing_certificate? end + let(:assessment) { create(:assessment, application_form:) } + it { is_expected.to be false } context "when the teaching authority provides the written statement" do let(:application_form) do create( :application_form, - assessment:, - teacher: current_teacher, teaching_authority_provides_written_statement: true, ) end before { create(:professional_standing_request, :requested, assessment:) } - it { is_expected.to be false } + context "when there are preliminary checks and they are not complete" do + before do + application_form.update!(requires_preliminary_check: true) + create(:assessment_section, :preliminary, assessment:) + end + + it { is_expected.to be false } + end context "when there are preliminary checks and they are complete" do before do diff --git a/spec/views/teacher_interface/application_forms_show_spec.rb b/spec/views/teacher_interface/application_forms_show_spec.rb index d81c4357db..5ec9128358 100644 --- a/spec/views/teacher_interface/application_forms_show_spec.rb +++ b/spec/views/teacher_interface/application_forms_show_spec.rb @@ -5,9 +5,7 @@ before do assign( :view_object, - TeacherInterface::ApplicationFormShowViewObject.new( - current_teacher: application_form.teacher, - ), + TeacherInterface::ApplicationFormViewObject.new(application_form:), ) end @@ -46,7 +44,7 @@ end it { is_expected.to match(/Your QTS application has been declined/) } - it { is_expected.to match(/Notes/) } + it { is_expected.to match(/Why your application was declined/) } it { is_expected.to match(/you can make a new application in future/) } end From 1beea5f5dc524c61143788da58b27e2a471746d2 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Thu, 9 Nov 2023 16:17:17 +0000 Subject: [PATCH 3/3] Update decline email and view content This updates the content of the decline email and view to match the changes requested by our content designers. --- app/mailers/teacher_mailer.rb | 3 ++ .../edit.html.erb | 16 +++--- .../application_forms/show/_declined.html.erb | 51 +++++++------------ .../application_declined.text.erb | 42 ++++++++++----- config/locales/mailer.en.yml | 2 +- spec/mailers/teacher_mailer_spec.rb | 24 +-------- .../application_forms_show_spec.rb | 6 +-- 7 files changed, 64 insertions(+), 80 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index 09a93c9e82..24ff4d3980 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -19,6 +19,9 @@ def application_awarded end def application_declined + @view_object = + TeacherInterface::ApplicationFormViewObject.new(application_form:) + view_mail( GOVUK_NOTIFY_TEMPLATE_ID, to: teacher.email, diff --git a/app/views/assessor_interface/assessment_recommendation_decline/edit.html.erb b/app/views/assessor_interface/assessment_recommendation_decline/edit.html.erb index 6726e56540..4c06ccc685 100644 --- a/app/views/assessor_interface/assessment_recommendation_decline/edit.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_decline/edit.html.erb @@ -32,21 +32,21 @@ <% @assessment.sections.not_preliminary.each do |section| %> <% if (selected_failure_reasons = section.selected_failure_reasons).present? %>

<%= t(".assessment_section.#{section.key}") %>

-
    +
      <% selected_failure_reasons.each do |failure_reason| %>
    • <%= t(failure_reason.key, scope: %i[assessor_interface assessment_sections failure_reasons as_statement]) %>

      - <% if FailureReasons.decline?(failure_reason: failure_reason.key) %> -

      Your note to the applicant:

      - <% else %> -

      Your note (the applicant won’t see this):

      - <% end %> + <% if (assessor_feedback = failure_reason.assessor_feedback).present? %> + <% if FailureReasons.decline?(failure_reason: failure_reason.key) %> +

      Your note to the applicant:

      + <% else %> +

      Your note (the applicant won’t see this):

      + <% end %> - <%= govuk_inset_text do %> - <%= simple_format failure_reason.assessor_feedback %> + <%= govuk_inset_text { simple_format assessor_feedback } %> <% end %>
    • <% end %> diff --git a/app/views/teacher_interface/application_forms/show/_declined.html.erb b/app/views/teacher_interface/application_forms/show/_declined.html.erb index 148e68a92e..0a16be6904 100644 --- a/app/views/teacher_interface/application_forms/show/_declined.html.erb +++ b/app/views/teacher_interface/application_forms/show/_declined.html.erb @@ -1,50 +1,35 @@

      Your QTS application has been declined

      -

      Why your application was declined

      +

      Thank you for applying for qualified teacher status (QTS) and for your patience while we reviewed your application.

      -<% if (declined_reasons = view_object.declined_reasons).present? %> - <% declined_reasons.each do |title, reasons| %> - <% if title.present? %> -

      <%= title %>

      - <% end %> +

      Reason for decline

      -
        - <% reasons.each do |reason| %> -
      • <%= simple_format reason %>
      • - <% end %> -
      +<% view_object.declined_reasons.each do |title, reasons| %> + <% if title.present? %> +

      <%= title %>

      <% end %> + +
        + <% reasons.each do |reason| %> +
      • <%= simple_format reason %>
      • + <% end %> +
      <% end %> <% unless view_object.declined_cannot_reapply? %> -

      What you can do next

      - -

      While your QTS application was declined this time, you can make a new application in future, if you’re able to address the decline reasons we’ve set out.

      - -

      If you reapply for QTS, you will not be able to review the details of your previous application.

      +

      What you can do next

      -

      <%= govuk_button_link_to "Apply again", new_teacher_interface_application_form_path %>

      +

      You’ll be able to make a new application for QTS once you've addressed the decline reasons we've given. If you reapply for QTS, you’ll not be able to review the details of your previous application.

      -

      Other routes to teaching in England

      +

      <%= govuk_button_link_to "Apply again", %i[new teacher_interface application_form] %>

      -

      You may want to explore other routes to teaching in England. QTS is not a requirement to teach in independent (private) schools, academies, free schools and in the further education (FE) sector in England.

      - -

      You can find out more about working in these sectors from:

      - -
        -
      • <%= govuk_link_to "Independent Schools Council", "http://www.isc.co.uk/" %>
      • -
      • <%= govuk_link_to "The Education & Training Foundation", "http://www.et-foundation.co.uk/" %>
      • -
      • <%= govuk_link_to "Academies and Free Schools", "https://www.gov.uk/types-of-school" %>
      • -
      - -

      For further information on other routes to gaining QTS visit <%= govuk_link_to "Get Into Teaching", "https://getintoteaching.education.gov.uk/non-uk-teachers/teach-in-england-if-you-trained-overseas" %>.

      -

      You can also learn more about <%= govuk_link_to "training to teach in England", "https://getintoteaching.education.gov.uk/non-uk-teachers/train-to-teach-in-england-as-an-international-student" %>.

      +

      You may want to <%= govuk_link_to "explore other routes to getting QTS", "https://www.gov.uk/government/publications/apply-for-qualified-teacher-status-qts-if-you-teach-outside-the-uk/routes-to-qualified-teacher-status-qts-for-teachers-and-those-with-teaching-experience-outside-the-uk" %>.

      <% end %> -

      Decision review

      +

      Decision review

      Applicants who have been declined for QTS are entitled to a review of the decline decision by a Casework Manager.

      -

      If you would like to request a decision review, you will need to provide:

      +

      If you would like to request a decision review, you’ll need to provide:

      • formal evidence and reasoning as to how you meet the required assessment criteria
      • @@ -52,7 +37,5 @@

      Your request for review must be received within 28 days of receipt of the decision to decline QTS.

      -

      Email your request for review, including the information required as above, to <%= govuk_link_to t("service.email.enquiries"), "mailto:#{t("service.email.enquiries")}" %>.

      -

      If you are not satisfied with the outcome of the decision review, you can request a final formal appeal to a senior Teacher Qualification Manager.

      diff --git a/app/views/teacher_mailer/application_declined.text.erb b/app/views/teacher_mailer/application_declined.text.erb index 0554fb0fee..cf26828a54 100644 --- a/app/views/teacher_mailer/application_declined.text.erb +++ b/app/views/teacher_mailer/application_declined.text.erb @@ -1,25 +1,43 @@ Dear <%= application_form_full_name(@application_form) %> -# Your QTS application has been declined - <%= render "shared/teacher_mailer/reference_number" %> -Thank you for applying for qualified teacher status (QTS) and for your patience while we reviewed your application. +Thank you for applying for QTS in England. Unfortunately, your application has been declined. + +# Reason for decline -Unfortunately, we’re unable to award QTS status. +<% @view_object.declined_reasons.each do |title, reasons| %> +<% if title.present? %> +## <%= title %> -<%- if @further_information_requested -%> +<% end %> +<% reasons.each do |reason| %> +- <%= reason.gsub("\n\n", "\n").gsub("\n", "\n ") %> +<% end %> + +<% end %> +<% unless @view_object.declined_cannot_reapply? %> # What you can do next -You can sign in to find out why your application was declined: -<%- else -%> -# Why your QTS application was declined +You’ll be able to make a new application for QTS once you've addressed the decline reasons we've given. If you reapply for QTS, you’ll not be able to review the details of your previous application. + +[Apply again](<%= new_teacher_interface_application_form_url %>) + +You may want to [explore other routes to getting QTS](https://www.gov.uk/government/publications/apply-for-qualified-teacher-status-qts-if-you-teach-outside-the-uk/routes-to-qualified-teacher-status-qts-for-teachers-and-those-with-teaching-experience-outside-the-uk). + +<% end %> +# Decision review + +Applicants who have been declined for QTS are entitled to a review of the decline decision by a Casework Manager. +If you would like to request a decision review, you’ll need to provide: + +- formal evidence and reasoning as to how you meet the required assessment criteria +- additional information not included in your original application that would support your decision review -You can sign in to find out why your application was declined: -<%- end -%> +Your request for review must be received within 28 days of receipt of the decision to decline QTS. Email your request for review, including the information required as above, to <%= t("service.email.enquiries") %>. -<%= new_teacher_session_url %> +If you are not satisfied with the outcome of the decision review, you can request a final formal appeal to a senior Teacher Qualification Manager. -<%= render "shared/teacher_mailer/help_us_to_improve_this_service" %> +[Sign in](<%= new_teacher_session_url %>) to review the outcome of your application. <%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index f1e6cd35bd..41ce1cc8cf 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -9,7 +9,7 @@ en: application_awarded: subject: Your QTS application was successful application_declined: - subject: Your QTS application has been declined + subject: Your QTS application was unsuccessful application_not_submitted: subject: 0: Your draft QTS application will be deleted in 2 weeks diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index d2ca15405a..aa19157b5e 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -58,7 +58,7 @@ describe "#subject" do subject(:subject) { mail.subject } - it { is_expected.to eq("Your QTS application has been declined") } + it { is_expected.to eq("Your QTS application was unsuccessful") } end describe "#to" do @@ -72,30 +72,10 @@ it { is_expected.to include("Dear First Last") } it { is_expected.to include("abc") } - it do - is_expected.to include( - "You can sign in to find out why your application was declined:", - ) - end + it { is_expected.to include("Reason for decline") } end it_behaves_like "an observable mailer", "application_declined" - - context "further information requested" do - let(:assessment) do - create(:assessment, :with_further_information_request) - end - - describe "#body" do - subject(:body) { mail.body.encoded } - - it do - is_expected.to include( - "You can sign in to find out why your application was declined:", - ) - end - end - end end describe "#application_not_submitted" do diff --git a/spec/views/teacher_interface/application_forms_show_spec.rb b/spec/views/teacher_interface/application_forms_show_spec.rb index 5ec9128358..ac4b5144e2 100644 --- a/spec/views/teacher_interface/application_forms_show_spec.rb +++ b/spec/views/teacher_interface/application_forms_show_spec.rb @@ -44,8 +44,8 @@ end it { is_expected.to match(/Your QTS application has been declined/) } - it { is_expected.to match(/Why your application was declined/) } - it { is_expected.to match(/you can make a new application in future/) } + it { is_expected.to match(/Reason for decline/) } + it { is_expected.to match(/You’ll be able to make a new application/) } end context "and a further information request" do @@ -62,7 +62,7 @@ end it { is_expected.to match(/Your QTS application has been declined/) } - it { is_expected.to match(/you can make a new application in future/) } + it { is_expected.to match(/You’ll be able to make a new application/) } it "does not show the assessor notes to the applicant" do expect(subject).not_to match(/A note/)