diff --git a/app/assets/stylesheets/_email_preview.scss b/app/assets/stylesheets/_email_preview.scss deleted file mode 100644 index 964b2ba753..0000000000 --- a/app/assets/stylesheets/_email_preview.scss +++ /dev/null @@ -1,20 +0,0 @@ -.app-email-preview__header { - background-color: govuk-colour("black"); - color: govuk-colour("white"); - padding: govuk-spacing(2); -} - -.app-email-preview__header__logo { - font-size: 28px; - font-weight: bold; - width: 580px; - margin-left: auto; - margin-right: auto; -} - -.app-email-preview__content { - border-top: 10px govuk-colour("blue") solid; - width: 580px; - margin-left: auto; - margin-right: auto; -} diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss index af652dc58a..b579f114b7 100644 --- a/app/assets/stylesheets/application.sass.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -12,7 +12,6 @@ $moj-images-path: "/"; @import "_application_forms"; @import "_checkbox_search_filter"; @import "_description_list"; -@import "_email_preview"; @import "_environments"; @import "_search_results"; @import "_support"; diff --git a/app/components/preview_mailer/component.html.erb b/app/components/preview_mailer/component.html.erb deleted file mode 100644 index ceb282683b..0000000000 --- a/app/components/preview_mailer/component.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -
-
- -
- -
- <%= preview.html_safe %> -
-
diff --git a/app/components/preview_mailer/component.rb b/app/components/preview_mailer/component.rb deleted file mode 100644 index a8a8e22a14..0000000000 --- a/app/components/preview_mailer/component.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class PreviewMailer::Component < ViewComponent::Base - def initialize(mailer_class:, name:, **params) - super - @mailer_class = mailer_class - @name = name - @params = params - end - - def preview - MailerPreview.with(mailer_class, **params).send(name) - end - - attr_reader :mailer_class, :name, :params -end diff --git a/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb index 004001a996..0924a788e2 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb @@ -92,10 +92,6 @@ def update_age_range_subjects end end - def preview - authorize %i[assessor_interface assessment_recommendation], :edit? - end - def edit_confirm authorize %i[assessor_interface assessment_recommendation], :edit? @form = AssessmentConfirmationForm.new diff --git a/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb index 59421cae59..3508fa2943 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb @@ -49,7 +49,7 @@ def update if @form.save redirect_to [ - :preview, + :confirm, :assessor_interface, application_form, assessment, @@ -60,10 +60,6 @@ def update end end - def preview - authorize %i[assessor_interface assessment_recommendation], :edit? - end - def edit_confirm authorize %i[assessor_interface assessment_recommendation], :edit? @form = AssessmentConfirmationForm.new diff --git a/app/controllers/assessor_interface/assessments_controller.rb b/app/controllers/assessor_interface/assessments_controller.rb index 8df872e1b8..22b7b82a0c 100644 --- a/app/controllers/assessor_interface/assessments_controller.rb +++ b/app/controllers/assessor_interface/assessments_controller.rb @@ -99,11 +99,11 @@ def assessment def update_redirect_path(recommendation) if recommendation == "request_further_information" [ - :preview, + :new, :assessor_interface, application_form, assessment, - :further_information_requests, + :further_information_request, ] else [ diff --git a/app/controllers/assessor_interface/further_information_requests_controller.rb b/app/controllers/assessor_interface/further_information_requests_controller.rb index 81de688598..21c97ffd13 100644 --- a/app/controllers/assessor_interface/further_information_requests_controller.rb +++ b/app/controllers/assessor_interface/further_information_requests_controller.rb @@ -4,23 +4,25 @@ module AssessorInterface class FurtherInformationRequestsController < BaseController include HistoryTrackable - before_action only: %i[preview new create] do + before_action only: %i[new create] do authorize %i[assessor_interface further_information_request] end - before_action except: %i[preview new create] do + before_action except: %i[new create] do authorize [:assessor_interface, further_information_request] end - before_action :load_application_form_and_assessment, - only: %i[preview new edit] - before_action :load_new_further_information_request, only: %i[preview new] + before_action :load_application_form_and_assessment, only: %i[new edit] before_action :load_view_object, only: %i[edit update] - def preview - end - def new + @further_information_request = + assessment.further_information_requests.build( + items: + FurtherInformationRequestItemsFactory.call( + assessment_sections: assessment.sections, + ), + ) end def create @@ -73,16 +75,6 @@ def load_application_form_and_assessment @assessment = assessment end - def load_new_further_information_request - @further_information_request = - assessment.further_information_requests.build( - items: - FurtherInformationRequestItemsFactory.call( - assessment_sections: assessment.sections, - ), - ) - end - def load_view_object @view_object = view_object end diff --git a/app/lib/mailer_preview.rb b/app/lib/mailer_preview.rb deleted file mode 100644 index 51f0b98cff..0000000000 --- a/app/lib/mailer_preview.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -class MailerPreview - class << self - def with(mailer_class, **params) - new(mailer_class:, params:) - end - end - - def initialize(mailer_class:, params:) - @mailer_class = mailer_class - @params = params - end - - def respond_to_missing?(name) - mailer.respond_to?(name) - end - - def method_missing(name) - mail = mailer.send(name) - generate_preview(mail) - end - - private - - attr_reader :mailer_class, :params - - def client - @client ||= - begin - api_key = ENV["GOVUK_NOTIFY_API_KEY"] - Notifications::Client.new(api_key) if api_key.present? - end - end - - def mailer - @mailer ||= mailer_class.with(**params) - end - - def generate_preview(mail) - return "

Missing GOV.UK Notify API key.

" if client.nil? - - client.generate_template_preview( - ApplicationMailer::GOVUK_NOTIFY_TEMPLATE_ID, - personalisation: { - to: mail.to.first, - subject: mail.subject, - body: mail.body.encoded, - }, - ).html - end -end diff --git a/app/policies/assessor_interface/further_information_request_policy.rb b/app/policies/assessor_interface/further_information_request_policy.rb index 5138eb264e..ae4b255fae 100644 --- a/app/policies/assessor_interface/further_information_request_policy.rb +++ b/app/policies/assessor_interface/further_information_request_policy.rb @@ -5,8 +5,6 @@ def create? user.assess_permission end - alias_method :preview?, :new? - def update? user.assess_permission end diff --git a/app/views/assessor_interface/assessment_recommendation_award/age_range_subjects.html.erb b/app/views/assessor_interface/assessment_recommendation_award/age_range_subjects.html.erb index 7ed40ae40d..e510a46c30 100644 --- a/app/views/assessor_interface/assessment_recommendation_award/age_range_subjects.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_award/age_range_subjects.html.erb @@ -38,7 +38,6 @@ end end %> -
- <%= govuk_button_link_to "Continue", [:preview, :assessor_interface, @application_form, @assessment, :assessment_recommendation_award] %> - <%= render "shared/assessor_interface/cancel_link" %> -
+<%= form_with url: [:confirm, :assessor_interface, @application_form, @assessment, :assessment_recommendation_award] do |f| %> + <% render "shared/assessor_interface/continue_cancel_button", f: %> +<% end %> diff --git a/app/views/assessor_interface/assessment_recommendation_award/preview.html.erb b/app/views/assessor_interface/assessment_recommendation_award/preview.html.erb deleted file mode 100644 index 4fdfb77c98..0000000000 --- a/app/views/assessor_interface/assessment_recommendation_award/preview.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% content_for :page_title, t(".heading") %> -<% content_for :back_link_url, back_history_path(default: assessor_interface_application_form_path(@application_form)) %> - -

<%= t(".heading") %>

-

<%= t(".subheading") %>

-

<%= t(".description") %>

- -<%= render(PreviewMailer::Component.new( - mailer_class: TeacherMailer, - name: :application_awarded, - application_form: @application_form, -)) %> - -
- <%= govuk_button_link_to "Continue", [:confirm, :assessor_interface, @application_form, @assessment, :assessment_recommendation_award] %> - <%= render "shared/assessor_interface/cancel_link" %> -
diff --git a/app/views/assessor_interface/assessment_recommendation_decline/preview.html.erb b/app/views/assessor_interface/assessment_recommendation_decline/preview.html.erb deleted file mode 100644 index 8bc5fc6675..0000000000 --- a/app/views/assessor_interface/assessment_recommendation_decline/preview.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% content_for :page_title, t(".heading") %> -<% content_for :back_link_url, back_history_path(default: assessor_interface_application_form_path(@application_form)) %> - -

<%= t(".heading") %>

-

<%= t(".subheading") %>

-

<%= t(".description") %>

- -<%= render(PreviewMailer::Component.new( - mailer_class: TeacherMailer, - name: :application_declined, - application_form: @application_form, -)) %> - -
- <%= govuk_button_link_to "Continue", [:confirm, :assessor_interface, @application_form, @assessment, :assessment_recommendation_decline] %> - <%= render "shared/assessor_interface/cancel_link" %> -
diff --git a/app/views/assessor_interface/further_information_requests/new.html.erb b/app/views/assessor_interface/further_information_requests/new.html.erb index 49a875b921..73627c54fc 100644 --- a/app/views/assessor_interface/further_information_requests/new.html.erb +++ b/app/views/assessor_interface/further_information_requests/new.html.erb @@ -1,16 +1,43 @@ -<% content_for :page_title, "Further information request email preview" %> -<% content_for :back_link_url, back_history_path(default: preview_assessor_interface_application_form_assessment_further_information_requests_path) %> +<% content_for :page_title, "Check the further information you’re asking the applicant for" %> +<% content_for :back_link_url, back_history_path(default: edit_assessor_interface_application_form_assessment_path(@application_form, @assessment)) %> -

Further information request email preview

+

Check the information you’re asking the applicant for

-<%= render(PreviewMailer::Component.new( - mailer_class: TeacherMailer, - name: :further_information_requested, - application_form: @application_form, -)) %> +<% @further_information_request.items.group_by(&:failure_reason_key).each do |failure_reason_key, items| %> + <% if failure_reason_key == "school_details_cannot_be_verified" %> +
+

Reason for request

+ <% if items.size == 1 %> +

We were unable to verify the details for <%= items.first.work_history.school_name %>.

+ <% else %> +

We were unable to verify the details for:

+ + <% end %> +

Note to applicant

-<%= form_with model: [:assessor_interface, @application_form, @assessment, @further_information_request] do |f| %> - <%= f.govuk_submit "Send email to applicant" do %> - <%= govuk_button_link_to "Back to overview", assessor_interface_application_form_path(@application_form), secondary: true %> + <%= govuk_inset_text do %> + <%= simple_format items.first.failure_reason_assessor_feedback %> + <% end %> +
+ <% else %> + <% items.each do |item| %> +
+

<%= t(item.failure_reason_key, scope: %i[assessor_interface assessment_sections failure_reasons as_statement]) %>

+ +

Note to applicant

+ + <%= govuk_inset_text do %> + <%= simple_format item.failure_reason_assessor_feedback %> + <% end %> +
+ <% end %> <% end %> <% end %> + +<%= form_with model: [:assessor_interface, @application_form, @assessment, @further_information_request] do |f| %> + <% render "shared/assessor_interface/continue_cancel_button", f: %> +<% end %> diff --git a/app/views/assessor_interface/further_information_requests/preview.html.erb b/app/views/assessor_interface/further_information_requests/preview.html.erb deleted file mode 100644 index 7d5535271b..0000000000 --- a/app/views/assessor_interface/further_information_requests/preview.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<% content_for :page_title, "Check the further information you’re asking the applicant for" %> -<% content_for :back_link_url, back_history_path(default: edit_assessor_interface_application_form_assessment_path(@application_form, @assessment)) %> - -

Check the information you’re asking the applicant for

- -<% @further_information_request.items.group_by(&:failure_reason_key).each do |failure_reason_key, items| %> - <% if failure_reason_key == "school_details_cannot_be_verified" %> -
-

Reason for request

- <% if items.size == 1 %> -

We were unable to verify the details for <%= items.first.work_history.school_name %>.

- <% else %> -

We were unable to verify the details for:

- - <% end %> -

Note to applicant

- - <%= govuk_inset_text do %> - <%= simple_format items.first.failure_reason_assessor_feedback %> - <% end %> -
- <% else %> - <% items.each do |item| %> -
-

<%= t(item.failure_reason_key, scope: %i[assessor_interface assessment_sections failure_reasons as_statement]) %>

- -

Note to applicant

- - <%= govuk_inset_text do %> - <%= simple_format item.failure_reason_assessor_feedback %> - <% end %> -
- <% end %> - <% end %> -<% end %> - -
- <%= govuk_button_link_to "Continue", new_assessor_interface_application_form_assessment_further_information_request_path(@application_form, @assessment) %> - <%= govuk_button_link_to "Back to overview", assessor_interface_application_form_path(@application_form), secondary: true %> -
diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index d56519bd66..3b2f8ee6f0 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -54,10 +54,6 @@ en: heading: Confirm age range and subjects edit_age_range_subjects: heading: Edit age range and subjects - preview: - heading: Check the email - subheading: This screen shows how the email to the applicant will look. - description: Make sure you’re happy with the content, then select ‘Continue’, or select ‘Cancel’ to return to the application. edit_confirm: legend: Award this QTS application? hint: Select ‘Yes’ to confirm you want to award this application. If you’re not sure, or you need to check something, select ‘No’. @@ -72,10 +68,6 @@ en: english_language_proficiency: English language proficiency work_history: Work history professional_standing: Professional standing - preview: - heading: Check the email - subheading: This screen shows how the email to the applicant will look. - description: Make sure you’re happy with the content, then select ‘Continue’, or select ‘Cancel’ to return to the application. edit_confirm: legend: Decline this QTS application? hint: Select ‘Yes’ to confirm you want to decline this application. If you’re not sure, or you need to check something, select ‘No’. diff --git a/config/routes.rb b/config/routes.rb index 43fa6885c4..d8426ad75c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -56,7 +56,6 @@ to: "assessment_recommendation_award#edit_age_range_subjects" post "age-range-subjects/edit", to: "assessment_recommendation_award#update_age_range_subjects" - get "preview" get "confirm", to: "assessment_recommendation_award#edit_confirm" post "confirm", to: "assessment_recommendation_award#update_confirm" end @@ -65,7 +64,6 @@ controller: "assessment_recommendation_decline", path: "/recommendation/decline", only: %i[show edit update] do - get "preview" get "confirm", to: "assessment_recommendation_decline#edit_confirm" post "confirm", to: "assessment_recommendation_decline#update_confirm" end @@ -111,11 +109,7 @@ resources :further_information_requests, path: "/further-information-requests", - only: %i[new create edit update] do - get "preview", - to: "further_information_requests#preview", - on: :collection - end + only: %i[new create edit update] resource :professional_standing_request, path: "/professional-standing-request", diff --git a/spec/components/preview_mailer_component_spec.rb b/spec/components/preview_mailer_component_spec.rb deleted file mode 100644 index f90f6a4b30..0000000000 --- a/spec/components/preview_mailer_component_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require "rails_helper" - -RSpec.describe PreviewMailer::Component, type: :component do - let(:mailer_class) { TeacherMailer } - let(:name) { :name } - let(:teacher) { create(:teacher) } - let(:param) { "param" } - - subject(:component) do - render_inline(described_class.new(mailer_class:, name:, teacher:, param:)) - end - - let(:mailer) { double(name: "

Preview

") } - - before do - expect(MailerPreview).to receive(:with).with( - mailer_class, - teacher:, - param:, - ).and_return(mailer) - end - - it "renders the header" do - expect(component.css(".app-email-preview__header").text.strip).to eq( - "GOV.UK", - ) - end - - it "renders the content" do - expect(component.css(".app-email-preview__content").text.strip).to eq( - "Preview", - ) - end -end diff --git a/spec/lib/mailer_preview_spec.rb b/spec/lib/mailer_preview_spec.rb deleted file mode 100644 index 43744c554a..0000000000 --- a/spec/lib/mailer_preview_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -require "rails_helper" - -RSpec.describe MailerPreview do - let(:further_information_request) { create(:further_information_request) } - let(:application_form) do - further_information_request.assessment.application_form - end - let(:teacher) { application_form.teacher } - let(:notify_key) { "notify-key" } - let(:notify_client) do - double(generate_template_preview: notify_template_preview) - end - let(:notify_template_preview) { double(html: "email html") } - - around do |example| - ClimateControl.modify GOVUK_NOTIFY_API_KEY: notify_key do - example.run - end - end - - before do - allow(Notifications::Client).to receive(:new).with(notify_key).and_return( - notify_client, - ) - end - - describe "render preview" do - subject do - described_class.with( - TeacherMailer, - application_form:, - further_information_request:, - ).further_information_requested - end - - it { is_expected.to eq("email html") } - - it "renders the correct template" do - expect(notify_client).to receive(:generate_template_preview).with( - "95adafaf-0920-4623-bddc-340853c047af", - instance_of(Hash), - ) - subject - end - - it "passes the correct parameters" do - expect(notify_client).to receive(:generate_template_preview).with( - instance_of(String), - personalisation: { - to: teacher.email, - subject: - "We need some more information to progress your QTS application", - body: instance_of(String), - }, - ) - subject - end - end -end diff --git a/spec/policies/assessor_interface/further_information_request_policy_spec.rb b/spec/policies/assessor_interface/further_information_request_policy_spec.rb index 73f2065ee5..6f4b315999 100644 --- a/spec/policies/assessor_interface/further_information_request_policy_spec.rb +++ b/spec/policies/assessor_interface/further_information_request_policy_spec.rb @@ -20,11 +20,6 @@ it_behaves_like "a policy method without permission" end - describe "#preview?" do - subject(:preview?) { policy.preview? } - it_behaves_like "a policy method requiring the assess permission" - end - describe "#create?" do subject(:create?) { policy.create? } it_behaves_like "a policy method requiring the assess permission" diff --git a/spec/support/autoload/page_objects/assessor_interface/age_range_subjects_assessment_recommendation_award.rb b/spec/support/autoload/page_objects/assessor_interface/age_range_subjects_assessment_recommendation_award.rb index 622c8a726a..8b2a6eaa29 100644 --- a/spec/support/autoload/page_objects/assessor_interface/age_range_subjects_assessment_recommendation_award.rb +++ b/spec/support/autoload/page_objects/assessor_interface/age_range_subjects_assessment_recommendation_award.rb @@ -8,7 +8,7 @@ class AgeRangeSubjectsAssessmentRecommendationAward < SitePrism::Page element :heading, "h1" section :summary_list, GovukSummaryList, ".govuk-summary-list" - element :continue_button, "a.govuk-button" + element :continue_button, ".govuk-button" end end end diff --git a/spec/support/autoload/page_objects/assessor_interface/further_information_request_preview.rb b/spec/support/autoload/page_objects/assessor_interface/further_information_request_preview.rb deleted file mode 100644 index 36993df526..0000000000 --- a/spec/support/autoload/page_objects/assessor_interface/further_information_request_preview.rb +++ /dev/null @@ -1,17 +0,0 @@ -module PageObjects - module AssessorInterface - class FurtherInformationRequestPreview < SitePrism::Page - set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ - "/further-information-requests/new" - - element :email_preview, "div.app-email-preview" - - section :form, "form" do - element :send_to_applicant_button, - ".govuk-button:not(.govuk-button--secondary)" - element :back_to_overview_button, - ".govuk-button.govuk-button--secondary" - end - end - end -end diff --git a/spec/support/autoload/page_objects/assessor_interface/preview_assessment_recommendation.rb b/spec/support/autoload/page_objects/assessor_interface/preview_assessment_recommendation.rb deleted file mode 100644 index 1eb4369aa2..0000000000 --- a/spec/support/autoload/page_objects/assessor_interface/preview_assessment_recommendation.rb +++ /dev/null @@ -1,16 +0,0 @@ -module PageObjects - module AssessorInterface - class PreviewAssessmentRecommendation < SitePrism::Page - set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ - "/recommendation/{recommendation}/preview" - - element :heading, "h1" - - section :email_preview, ".app-email-preview" do - element :content, ".app-email-preview__content" - end - - element :send_button, ".govuk-button" - end - end -end diff --git a/spec/support/autoload/page_objects/assessor_interface/request_further_information.rb b/spec/support/autoload/page_objects/assessor_interface/request_further_information.rb index eb490f5079..04267511df 100644 --- a/spec/support/autoload/page_objects/assessor_interface/request_further_information.rb +++ b/spec/support/autoload/page_objects/assessor_interface/request_further_information.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module PageObjects module AssessorInterface class RequestFurtherInformation < SitePrism::Page set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ - "/further-information-requests/preview" + "/further-information-requests/new" sections :items, ".app-further-information-request-item" do element :heading, ".govuk-heading-s" diff --git a/spec/support/page_helpers.rb b/spec/support/page_helpers.rb index 3430bef35d..79f4ead034 100644 --- a/spec/support/page_helpers.rb +++ b/spec/support/page_helpers.rb @@ -122,11 +122,6 @@ def assessor_email_consent_letters_requests_assessment_recommendation_verify_pag PageObjects::AssessorInterface::EmailConsentLettersAssessmentRecommendationVerify.new end - def assessor_further_information_request_preview_page - @assessor_further_information_request_preview_page ||= - PageObjects::AssessorInterface::FurtherInformationRequestPreview.new - end - def assessor_locate_professional_standing_request_page @assessor_locate_professional_standing_request_page ||= PageObjects::AssessorInterface::LocateProfessionalStandingRequest.new @@ -136,11 +131,6 @@ def assessor_login_page @assessor_login_page ||= PageObjects::AssessorInterface::Login.new end - def assessor_preview_assessment_recommendation_page - @assessor_preview_assessment_recommendation_page ||= - PageObjects::AssessorInterface::PreviewAssessmentRecommendation.new - end - def assessor_professional_standing_assessment_recommendation_verify_page @assessor_professional_standing_assessment_recommendation_verify_page ||= PageObjects::AssessorInterface::ProfessionalStandingAssessmentRecommendationVerify.new diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index 3c672fe447..b50a268cda 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -3,27 +3,10 @@ require "rails_helper" RSpec.describe "Assessor completing assessment", type: :system do - let(:notify_key) { "notify-key" } - let(:notify_client) do - double(generate_template_preview: notify_template_preview) - end - let(:notify_template_preview) { double(html: "I am an email") } let(:assessor_user) do create(:staff, :with_assess_permission, :confirmed, name: "Authorized User") end - around do |example| - ClimateControl.modify GOVUK_NOTIFY_API_KEY: notify_key do - example.run - end - end - - before do - allow(Notifications::Client).to receive(:new).with(notify_key).and_return( - notify_client, - ) - end - it "award" do given_the_service_is_open given_i_am_authorized_as_an_assessor_user @@ -61,15 +44,6 @@ :assessor_age_range_subjects_assessment_recommendation_award_page, ) and_i_continue_from_age_range_subjects - - then_i_see_the( - :assessor_preview_assessment_recommendation_page, - reference:, - assessment_id:, - recommendation: "award", - ) - - when_i_send_the_email then_i_see_the( :assessor_confirm_assessment_recommendation_page, reference:, @@ -167,14 +141,6 @@ and_i_see_failure_reasons when_i_check_declaration - then_i_see_the( - :assessor_preview_assessment_recommendation_page, - reference:, - assessment_id:, - recommendation: "decline", - ) - - when_i_send_the_email then_i_see_the( :assessor_confirm_assessment_recommendation_page, reference:, @@ -370,10 +336,6 @@ def when_i_select_submit_verification_requests assessor_assessment_recommendation_verify_page.submit_button.click end - def when_i_send_the_email - assessor_preview_assessment_recommendation_page.send_button.click - end - def when_i_check_confirmation assessor_confirm_assessment_recommendation_page .form diff --git a/spec/system/assessor_interface/requesting_further_information_spec.rb b/spec/system/assessor_interface/requesting_further_information_spec.rb index 7dae7afc68..3fe6907622 100644 --- a/spec/system/assessor_interface/requesting_further_information_spec.rb +++ b/spec/system/assessor_interface/requesting_further_information_spec.rb @@ -3,24 +3,6 @@ require "rails_helper" RSpec.describe "Assessor requesting further information", type: :system do - let(:notify_key) { "notify-key" } - let(:notify_client) do - double(generate_template_preview: notify_template_preview) - end - let(:notify_template_preview) { double(html: "I am an email") } - - around do |example| - ClimateControl.modify GOVUK_NOTIFY_API_KEY: notify_key do - example.run - end - end - - before do - allow(Notifications::Client).to receive(:new).with(notify_key).and_return( - notify_client, - ) - end - it "completes an assessment" do given_the_service_is_open given_i_am_authorized_as_an_assessor_user @@ -41,15 +23,7 @@ ) and_i_see_the_further_information_request_items - when_i_click_continue_to_email_button - then_i_see_the( - :assessor_further_information_request_preview_page, - reference:, - assessment_id:, - ) - and_i_see_the_email_preview - - when_i_click_send_to_applicant + when_i_click_the_continue_button then_i_see_the(:assessor_application_status_page, reference:) and_i_receive_a_further_information_requested_email end @@ -78,23 +52,10 @@ def and_i_see_the_further_information_request_items ).to eq("A note.") end - def when_i_click_continue_to_email_button + def when_i_click_the_continue_button assessor_request_further_information_page.continue_button.click end - def and_i_see_the_email_preview - expect( - assessor_further_information_request_preview_page.email_preview, - ).to have_content("I am an email") - end - - def when_i_click_send_to_applicant - assessor_further_information_request_preview_page - .form - .send_to_applicant_button - .click - end - def and_i_receive_a_further_information_requested_email message = ActionMailer::Base.deliveries.last expect(message).to_not be_nil