diff --git a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb index aa2b8b3db..f010ecbfc 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb @@ -19,6 +19,12 @@ def show def edit authorize %i[assessor_interface assessment_recommendation] + + @professional_standing = session[:professional_standing] + @qualifications = + application_form.qualifications.where(id: session[:qualification_ids]) + @work_histories = + application_form.work_histories.where(id: session[:work_history_ids]) end def update @@ -106,13 +112,13 @@ def update_qualification_requests ) if @form.save - redirect_to [ + redirect_to back_to_summary_path( :email_consent_letters, :assessor_interface, application_form, assessment, :assessment_recommendation_verify, - ] + ) else render :edit_qualification_requests, status: :unprocessable_entity end @@ -157,13 +163,13 @@ def update_professional_standing if @form.valid? session[:professional_standing] = @form.verify_professional_standing - redirect_to [ + redirect_to back_to_summary_path( :reference_requests, :assessor_interface, application_form, assessment, :assessment_recommendation_verify, - ] + ) else render :edit_professional_standing, status: :unprocessable_entity end @@ -230,5 +236,19 @@ def load_assessment_and_application_form @assessment = assessment @application_form = application_form end + + def back_to_summary_path(*ordinary_path) + if ActiveModel::Type::Boolean.new.cast(params[:back_to_summary]) + [ + :edit, + :assessor_interface, + application_form, + assessment, + :assessment_recommendation_verify, + ] + else + ordinary_path + end + end end end diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb new file mode 100644 index 000000000..a5ee7d3a4 --- /dev/null +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb @@ -0,0 +1,56 @@ +<% content_for :page_title, t(".heading") %> +<% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %> + +
You have selected the following items for verification:
+ +<%= govuk_summary_list do |summary_list| %> + <% if @professional_standing %> + <%= summary_list.with_row do |row| + row.with_key { "LoPS" } + row.with_value { region_teaching_authority_name(@application_form.region).upcase_first } + row.with_action(text: "Change", href: professional_standing_assessor_interface_application_form_assessment_assessment_recommendation_verify_path(@application_form, @assessment, back_to_summary: "true"), visually_hidden_text: "LoPS") + end %> + <% end %> + + <% if @qualifications.present? %> + <%= summary_list.with_row do |row| + row.with_key { "Qualifications" } + row.with_value do %> +Select submit to:
+ +If you choose to verify this application's LoPS an admin will email the competent authority and record the response.
diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit_qualification_requests.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit_qualification_requests.html.erb index 6862bb899..1910b3ef0 100644 --- a/app/views/assessor_interface/assessment_recommendation_verify/edit_qualification_requests.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit_qualification_requests.html.erb @@ -4,6 +4,8 @@ <%= form_with model: @form, url: [:qualification_requests, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify] do |f| %> <%= f.govuk_error_summary %> + <%= f.hidden_field :back_to_summary, value: params[:back_to_summary] %> +The list of qualifications that the applicant has submitted is shown below:
diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit_reference_requests.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit_reference_requests.html.erb index a113dc081..61a39f593 100644 --- a/app/views/assessor_interface/assessment_recommendation_verify/edit_reference_requests.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit_reference_requests.html.erb @@ -24,6 +24,6 @@ <%= f.govuk_submit do %> - <%= govuk_link_to "Cancel", assessor_interface_application_form_path(@application_form) %> + <%= govuk_link_to "Cancel", [:assessor_interface, @application_form] %> <% end %> <% end %> diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index da0dce990..f95a2e376 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -85,6 +85,8 @@ en: heading: Send application for review assessment_recommendation_verify: + edit: + heading: Verification requests edit_qualification_requests: heading: Verify qualifications edit_verify_qualifications: diff --git a/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb new file mode 100644 index 000000000..660563dd1 --- /dev/null +++ b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module PageObjects + module AssessorInterface + class AssessmentRecommendationVerify < SitePrism::Page + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ + "/recommendation/verify/edit" + + element :submit_button, ".govuk-button" + end + end +end diff --git a/spec/support/page_helpers.rb b/spec/support/page_helpers.rb index 6b7fabc6a..32ea047a4 100644 --- a/spec/support/page_helpers.rb +++ b/spec/support/page_helpers.rb @@ -32,6 +32,11 @@ def assessor_assessment_recommendation_review_page PageObjects::AssessorInterface::AssessmentRecommendationReview.new end + def assessor_assessment_recommendation_verify_page + @assessor_assessment_recommendation_verify_page ||= + PageObjects::AssessorInterface::AssessmentRecommendationVerify.new + end + def assessor_assessment_section_page @assessor_assessment_section_page ||= PageObjects::AssessorInterface::AssessmentSection.new diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index c63471394..aa52ccafe 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -129,6 +129,13 @@ ) when_i_select_the_work_histories + then_i_see_the( + :assessor_assessment_recommendation_verify_page, + reference:, + assessment_id:, + ) + + when_i_select_submit_verification_requests then_i_see_the(:assessor_application_status_page, reference:) when_i_click_on_overview_button @@ -353,6 +360,10 @@ def when_i_select_the_work_histories form.submit_button.click end + 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