diff --git a/app/controllers/assessor_interface/qualification_requests_controller.rb b/app/controllers/assessor_interface/qualification_requests_controller.rb index 1eee4b8cf8..ce3ccfb38c 100644 --- a/app/controllers/assessor_interface/qualification_requests_controller.rb +++ b/app/controllers/assessor_interface/qualification_requests_controller.rb @@ -15,12 +15,14 @@ class QualificationRequestsController < BaseController ] before_action :set_member_variables, only: %i[ - edit - update edit_consent_method update_consent_method edit_request update_request + edit_verify + update_verify + edit_verify_failed + update_verify_failed edit_review update_review ] @@ -77,55 +79,6 @@ def generate_unsigned_consent_document ) end - def edit - received = - if requestable.received? - true - elsif requestable.expired? - false - end - - passed = (requestable.review_passed if requestable.received?) - - failed = - if requestable.expired? - case requestable.review_passed - when true - false - when false - true - end - end - - @form = - QualificationRequestForm.new( - requestable:, - user: current_staff, - received:, - passed:, - note: requestable.review_note, - failed:, - ) - end - - def update - @form = - QualificationRequestForm.new( - form_params.merge(requestable:, user: current_staff), - ) - - if @form.save - redirect_to [ - :assessor_interface, - application_form, - assessment, - :qualification_requests, - ] - else - render :edit, status: :unprocessable_entity - end - end - def edit_consent_method @form = ConsentMethodForm.new( @@ -201,6 +154,74 @@ def update_request end end + def edit_verify + @form = + RequestableVerifyPassedForm.new( + requestable:, + user: current_staff, + passed: requestable.verify_passed, + ) + end + + def update_verify + @form = + RequestableVerifyPassedForm.new( + requestable:, + user: current_staff, + **verify_passed_form_params, + ) + + if @form.save + if @form.passed + redirect_to [ + :assessor_interface, + application_form, + assessment, + :qualification_requests, + ] + else + redirect_to [ + :verify_failed, + :assessor_interface, + application_form, + assessment, + qualification_request, + ] + end + else + render :edit_verify, status: :unprocessable_entity + end + end + + def edit_verify_failed + @form = + RequestableVerifyFailedForm.new( + requestable:, + user: current_staff, + note: requestable.verify_note, + ) + end + + def update_verify_failed + @form = + RequestableVerifyFailedForm.new( + requestable:, + user: current_staff, + **verify_failed_form_params, + ) + + if @form.save + redirect_to [ + :assessor_interface, + requestable.application_form, + requestable.assessment, + :qualification_requests, + ] + else + render :edit_verify_failed, status: :unprocessable_entity + end + end + def edit_review @form = RequestableReviewForm.new(requestable:) end @@ -210,7 +231,7 @@ def update_review RequestableReviewForm.new( requestable:, user: current_staff, - **requestable_review_form_params, + **review_form_params, ) if @form.save @@ -268,15 +289,6 @@ def generate_unsigned_consent_document_form_params ).permit(:generated) end - def form_params - params.require(:assessor_interface_qualification_request_form).permit( - :received, - :passed, - :note, - :failed, - ) - end - def consent_method_form_params params.require(:assessor_interface_consent_method_form).permit( :consent_method, @@ -289,11 +301,23 @@ def upload_unsigned_consent_document_form_params ).permit(:original_attachment) end - def requestable_review_form_params + def review_form_params params.require(:assessor_interface_requestable_review_form).permit( :passed, :note, ) end + + def verify_passed_form_params + params.require(:assessor_interface_requestable_verify_passed_form).permit( + :passed, + ) + end + + def verify_failed_form_params + params.require(:assessor_interface_requestable_verify_failed_form).permit( + :note, + ) + end end end diff --git a/app/forms/assessor_interface/qualification_request_form.rb b/app/forms/assessor_interface/qualification_request_form.rb deleted file mode 100644 index df260065f9..0000000000 --- a/app/forms/assessor_interface/qualification_request_form.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -class AssessorInterface::QualificationRequestForm - include ActiveModel::Model - include ActiveModel::Attributes - - attr_accessor :requestable, :user - validates :requestable, :user, presence: true - - attribute :received, :boolean - validates :received, inclusion: [true, false] - - attribute :passed, :boolean - validates :passed, inclusion: [true, false], if: :received - - attribute :note, :string - validates :note, presence: true, if: -> { received && passed == false } - - attribute :failed, :boolean - validates :failed, inclusion: [true, false], unless: :received - - def save - return false if invalid? - - ActiveRecord::Base.transaction do - if received && !requestable.received? - ReceiveRequestable.call(requestable:, user:) - elsif !received && requestable.received? - UnreceiveRequestable.call(requestable:, user:) - end - - if review_passed.nil? - requestable.update!(review_passed: nil, reviewed_at: nil) - ApplicationFormStatusUpdater.call(application_form:, user:) - else - ReviewRequestable.call( - requestable:, - user:, - passed: review_passed, - note:, - ) - end - end - - true - end - - delegate :application_form, :assessment, to: :requestable - - private - - def review_passed - if received - passed - else - failed ? false : nil - end - end -end diff --git a/app/models/assessment.rb b/app/models/assessment.rb index 43f953f560..c87ffda426 100644 --- a/app/models/assessment.rb +++ b/app/models/assessment.rb @@ -122,19 +122,6 @@ def can_decline? elsif request_further_information? all_further_information_requests_reviewed? && any_further_information_requests_failed? - elsif verify? - if professional_standing_request_verify_failed? || - any_reference_requests_verify_failed? || - any_consent_requests_verify_failed? - return false - end - - return false unless all_consent_requests_verified? - return false unless all_qualification_requests_reviewed? - return false unless all_reference_requests_verified? - return false unless professional_standing_request_verified? - - any_qualification_requests_review_failed? elsif review? return false unless all_consent_requests_reviewed? return false unless all_qualification_requests_reviewed? @@ -165,7 +152,7 @@ def can_review? return false unless application_form.created_under_new_regulations? return false unless all_consent_requests_verified? - return false unless all_qualification_requests_reviewed? + return false unless all_qualification_requests_verified? return false unless all_reference_requests_verified? return false unless professional_standing_request_verified? @@ -215,10 +202,6 @@ def any_not_preliminary_section_finished? sections.not_preliminary.any?(&:finished?) end - def all_reference_requests_verified? - reference_requests.all?(&:verified?) - end - def enough_reference_requests_verify_passed? return false if any_reference_requests_verify_failed? @@ -287,14 +270,18 @@ def enough_reference_requests_review_passed? ).enough_for_submission? end - def any_reference_requests_verify_failed? - reference_requests.any?(&:verify_failed?) - end - def any_reference_requests_review_failed? reference_requests.any?(&:review_failed?) end + def all_reference_requests_verified? + reference_requests.all?(&:verified?) + end + + def any_reference_requests_verify_failed? + reference_requests.any?(&:verify_failed?) + end + def all_consent_requests_reviewed? consent_requests.where(verify_passed: false).all?(&:reviewed?) end @@ -326,17 +313,29 @@ def all_qualification_requests_reviewed? if all_consent_requests_verified? && any_consent_requests_verify_failed? return true end - qualification_requests.all?(&:reviewed?) + + qualification_requests.where(verify_passed: false).all?(&:reviewed?) end def all_qualification_requests_review_passed? - qualification_requests.all?(&:review_passed?) + qualification_requests.all? do |qualification_request| + qualification_request.verify_passed? || + qualification_request.review_passed? + end end def any_qualification_requests_review_failed? qualification_requests.any?(&:review_failed?) end + def all_qualification_requests_verified? + qualification_requests.all?(&:verified?) + end + + def all_qualification_requests_verify_passed? + qualification_requests.all?(&:verify_passed?) + end + def any_qualification_requests_verify_failed? qualification_requests.any?(&:verify_failed?) end diff --git a/app/policies/assessor_interface/qualification_request_policy.rb b/app/policies/assessor_interface/qualification_request_policy.rb index d04bac87d6..2208c11598 100644 --- a/app/policies/assessor_interface/qualification_request_policy.rb +++ b/app/policies/assessor_interface/qualification_request_policy.rb @@ -24,10 +24,6 @@ def generate_unsigned_consent_document? user.verify_permission end - def update? - user.verify_permission - end - def update_consent_method? user.verify_permission end @@ -40,6 +36,18 @@ def update_request? alias_method :edit_request?, :update_request? + def update_verify? + user.verify_permission + end + + alias_method :edit_verify?, :update_verify? + + def update_verify_failed? + user.verify_permission + end + + alias_method :edit_verify_failed?, :update_verify_failed? + def update_review? user.assess_permission end diff --git a/app/view_objects/assessor_interface/qualification_requests_view_object.rb b/app/view_objects/assessor_interface/qualification_requests_view_object.rb index aec358e3e4..756f947316 100644 --- a/app/view_objects/assessor_interface/qualification_requests_view_object.rb +++ b/app/view_objects/assessor_interface/qualification_requests_view_object.rb @@ -261,10 +261,21 @@ def ecctis_task_items(qualification_request) }, { name: "Record Ecctis response", - link: "#", - status: + link: if can_start && qualification_request.requested? - qualification_request.received? ? "completed" : "waiting_on" + [ + :verify, + :assessor_interface, + application_form, + assessment, + qualification_request, + ] + end, + status: + if qualification_request.verify_passed? + "completed" + elsif qualification_request.requested? + qualification_request.status else "cannot_start" end, diff --git a/app/views/assessor_interface/qualification_requests/edit.html.erb b/app/views/assessor_interface/qualification_requests/edit.html.erb deleted file mode 100644 index 7281a123a7..0000000000 --- a/app/views/assessor_interface/qualification_requests/edit.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<% title = qualification_title(@qualification_request.qualification) %> - -<% content_for :page_title, title_with_error_prefix(title, error: @form.errors.any?) %> -<% content_for :back_link_url, back_history_path(default: assessor_interface_application_form_assessment_qualification_requests_path) %> - -<%= form_with model: @form, url: [:assessor_interface, @application_form, @assessment, @qualification_request], method: :put do |f| %> - <%= f.govuk_error_summary %> - -
You have opted to send this qualification for review.
+ + <%= f.govuk_text_area :note, label: { text: "Internal note: briefly explain to the assessor why you are sending this qualification for review." } %> + + <%= render "shared/assessor_interface/continue_cancel_button", f: %> +<% end %> diff --git a/app/views/assessor_interface/reference_requests/index.html.erb b/app/views/assessor_interface/reference_requests/index.html.erb index a5027c655b..ba42090ad2 100644 --- a/app/views/assessor_interface/reference_requests/index.html.erb +++ b/app/views/assessor_interface/reference_requests/index.html.erb @@ -22,6 +22,4 @@ } ]) %> -<% if @assessment.enough_reference_requests_verify_passed? || @assessment.all_reference_requests_verified? %> - <%= govuk_button_link_to "Continue", [:assessor_interface, @application_form] %> -<% end %> +<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %> diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index cd3b95fe7e..dc8ca7b7fd 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -362,16 +362,6 @@ en: inclusion: Select whether you received a response about this letter of professional standing expired: inclusion: Select whether you want to mark this for review - assessor_interface/qualification_request_form: - attributes: - received: - inclusion: Select whether you have received a response about this qualification - passed: - inclusion: Select whether the response shows that the qualification is legitimate - failure_assessor_note: - blank: Enter why you selected ‘No’ - failed: - inclusion: Select whether you want to mark this qualification as ‘Rejected’ assessor_interface/requestable_request_form: attributes: passed: diff --git a/config/locales/helpers.en.yml b/config/locales/helpers.en.yml index 9b8250d78f..e2bc8ed609 100644 --- a/config/locales/helpers.en.yml +++ b/config/locales/helpers.en.yml @@ -109,17 +109,6 @@ en: location: Country trained in name: Applicant name reference: Application reference number - assessor_interface_qualification_request_form: - received_options: - true: "Yes" - false: "No" - passed_options: - true: "Yes" - false: "No" - failure_assessor_note: 'Internal note: Briefly explain why you selected ‘No’' - failed_options: - true: Yes, mark as rejected - false: No, allow more time for a response assessor_interface_requestable_review_form: passed_options: true: Yes, mark as accepted @@ -288,10 +277,6 @@ en: submitted_at: Created date submitted_at_after: Start date submitted_at_before: End date - assessor_interface_qualification_request_form: - received: Have you received a response about this qualification? - passed: Does the response show that the qualification is legitimate? - failed: Do you want to mark this qualification as ‘Rejected’? assessor_interface_select_work_histories_form: work_history_ids: Schools eligibility_interface_region_form: diff --git a/config/routes.rb b/config/routes.rb index 74c7f82789..f636d4f75e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -147,7 +147,7 @@ resources :qualification_requests, path: "/qualification-requests", - only: %i[index edit update] do + only: %i[index] do collection do get "consent-methods", to: "qualification_requests#index_consent_methods" @@ -169,6 +169,11 @@ to: "qualification_requests#update_consent_method" get "request", to: "qualification_requests#edit_request" post "request", to: "qualification_requests#update_request" + get "verify", to: "qualification_requests#edit_verify" + post "verify", to: "qualification_requests#update_verify" + get "verify-failed", to: "qualification_requests#edit_verify_failed" + post "verify-failed", + to: "qualification_requests#update_verify_failed" get "review", to: "qualification_requests#edit_review" post "review", to: "qualification_requests#update_review" end diff --git a/spec/forms/assessor_interface/qualification_request_form_spec.rb b/spec/forms/assessor_interface/qualification_request_form_spec.rb deleted file mode 100644 index 0797274cdc..0000000000 --- a/spec/forms/assessor_interface/qualification_request_form_spec.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -require "rails_helper" - -RSpec.describe AssessorInterface::QualificationRequestForm, type: :model do - let(:requestable) { create(:qualification_request) } - let(:user) { create(:staff) } - - let(:received) { "" } - let(:passed) { "" } - let(:note) { "" } - let(:failed) { "" } - - subject(:form) do - described_class.new(requestable:, user:, received:, passed:, note:, failed:) - end - - describe "validations" do - it { is_expected.to validate_presence_of(:requestable) } - it { is_expected.to validate_presence_of(:user) } - it { is_expected.to allow_values(true, false).for(:received) } - it { is_expected.to allow_values(true, false).for(:passed) } - it { is_expected.to allow_values(true, false).for(:failed) } - - context "when received" do - let(:received) { "true" } - - it { is_expected.to_not allow_values(nil).for(:passed) } - - context "and not passed" do - let(:passed) { "false" } - - it { is_expected.to validate_presence_of(:note) } - end - end - - context "when not received" do - let(:received) { "false" } - - it { is_expected.to_not allow_values(nil).for(:failed) } - end - end - - describe "#save" do - subject(:save) { form.save } - - context "when received and passed" do - let(:received) { "true" } - let(:passed) { "true" } - - it { is_expected.to be true } - - it "sets the received at date" do - expect { save }.to change(requestable, :received_at).from(nil) - end - - it "sets review passed" do - expect { save }.to change(requestable, :review_passed).to(true) - end - - it "records a received timeline event" do - expect { save }.to have_recorded_timeline_event( - :requestable_received, - creator: user, - requestable:, - ) - end - - it "records an reviewed timeline event" do - expect { save }.to have_recorded_timeline_event( - :requestable_reviewed, - creator: user, - requestable:, - ) - end - end - - context "when received and not passed" do - let(:received) { "true" } - let(:passed) { "false" } - let(:note) { "Note." } - - it { is_expected.to be true } - - it "sets the received at date" do - expect { save }.to change(requestable, :received_at).from(nil) - end - - it "sets review passed" do - expect { save }.to change(requestable, :review_passed).to(false) - end - - it "sets review note" do - expect { save }.to change(requestable, :review_note).to("Note.") - end - - it "records a received timeline event" do - expect { save }.to have_recorded_timeline_event( - :requestable_received, - creator: user, - requestable:, - ) - end - - it "records an reviewed timeline event" do - expect { save }.to have_recorded_timeline_event( - :requestable_reviewed, - creator: user, - requestable:, - ) - end - end - - context "when not received and failed" do - let(:received) { "false" } - let(:failed) { "true" } - - it { is_expected.to be true } - - it "sets review passed" do - expect { save }.to change(requestable, :review_passed).to(false) - end - - it "records an assessed timeline event" do - expect { save }.to have_recorded_timeline_event( - :requestable_reviewed, - creator: user, - requestable:, - ) - end - end - - context "when not received and not failed" do - let(:received) { "false" } - let(:failed) { "false" } - - it { is_expected.to be true } - - it "doesn't set review passed" do - expect { save }.to_not change(requestable, :review_passed) - end - - it "doesn't record a reviewed timeline event" do - expect { save }.to_not have_recorded_timeline_event( - :requestable_reviewed, - ) - end - end - end -end diff --git a/spec/policies/assessor_interface/qualification_request_policy_spec.rb b/spec/policies/assessor_interface/qualification_request_policy_spec.rb index e3d7a443d2..e2441eba78 100644 --- a/spec/policies/assessor_interface/qualification_request_policy_spec.rb +++ b/spec/policies/assessor_interface/qualification_request_policy_spec.rb @@ -63,12 +63,12 @@ describe "#update?" do subject(:update?) { policy.update? } - it_behaves_like "a policy method requiring the verify permission" + it_behaves_like "a policy method without permission" end describe "#edit?" do subject(:edit?) { policy.edit? } - it_behaves_like "a policy method requiring the verify permission" + it_behaves_like "a policy method without permission" end describe "#update_consent_method?" do @@ -91,6 +91,26 @@ it_behaves_like "a policy method requiring the verify permission" end + describe "#update_verify?" do + subject(:update_verify?) { policy.update_verify? } + it_behaves_like "a policy method requiring the verify permission" + end + + describe "#edit_verify?" do + subject(:edit_verify?) { policy.edit_verify? } + it_behaves_like "a policy method requiring the verify permission" + end + + describe "#update_verify_failed?" do + subject(:update_verify_failed?) { policy.update_verify_failed? } + it_behaves_like "a policy method requiring the verify permission" + end + + describe "#edit_verify_failed?" do + subject(:edit_verify_failed?) { policy.edit_verify_failed? } + it_behaves_like "a policy method requiring the verify permission" + end + describe "#update_review?" do subject(:update_review?) { policy.update_review? } it_behaves_like "a policy method requiring the assess permission" diff --git a/spec/support/autoload/page_objects/assessor_interface/edit_qualification_request.rb b/spec/support/autoload/page_objects/assessor_interface/edit_qualification_request.rb deleted file mode 100644 index e1ec747093..0000000000 --- a/spec/support/autoload/page_objects/assessor_interface/edit_qualification_request.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module PageObjects - module AssessorInterface - class EditQualificationRequest < SitePrism::Page - set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ - "/qualification-requests/{id}/edit" - - section :form, "form" do - element :received_true_radio_item, - "#assessor-interface-qualification-request-form-received-true-field", - visible: false - element :received_false_radio_item, - "#assessor-interface-qualification-request-form-received-false-field", - visible: false - - element :passed_true_radio_item, - "#assessor-interface-qualification-request-form-passed-true-field", - visible: false - element :passed_false_radio_item, - "#assessor-interface-qualification-request-form-passed-false-field", - visible: false - - element :note_field, - "#assessor-interface-qualification-request-form-note-field" - - element :failed_true_radio_item, - "#assessor-interface-qualification-request-form-failed-true-field", - visible: false - element :failed_false_radio_item, - "#assessor-interface-qualification-request-form-failed-false-field", - visible: false - - element :submit_button, ".govuk-button" - end - end - end -end diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_failed_qualification_request.rb b/spec/support/autoload/page_objects/assessor_interface/verify_failed_qualification_request.rb new file mode 100644 index 0000000000..bf80db1c97 --- /dev/null +++ b/spec/support/autoload/page_objects/assessor_interface/verify_failed_qualification_request.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module PageObjects + module AssessorInterface + class VerifyFailedQualificationRequest < VerifyFailedRequestablePage + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ + "/qualification-requests/{id}/verify-failed" + end + end +end diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_qualification_request.rb b/spec/support/autoload/page_objects/assessor_interface/verify_qualification_request.rb new file mode 100644 index 0000000000..6384cd3944 --- /dev/null +++ b/spec/support/autoload/page_objects/assessor_interface/verify_qualification_request.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module PageObjects + module AssessorInterface + class VerifyQualificationRequest < VerifyRequestablePage + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ + "/qualification-requests/{id}/verify" + end + end +end diff --git a/spec/support/page_helpers.rb b/spec/support/page_helpers.rb index 29c64e36e5..ff775e13e3 100644 --- a/spec/support/page_helpers.rb +++ b/spec/support/page_helpers.rb @@ -112,11 +112,6 @@ def assessor_edit_application_page PageObjects::AssessorInterface::EditApplication.new end - def assessor_edit_qualification_request_page - @assessor_edit_qualification_request_page ||= - PageObjects::AssessorInterface::EditQualificationRequest.new - end - def assessor_edit_work_history_page @assessor_edit_work_history_page ||= PageObjects::AssessorInterface::EditWorkHistory.new @@ -270,6 +265,11 @@ def assessor_verify_failed_professional_standing_request_page PageObjects::AssessorInterface::VerifyFailedProfessionalStandingRequest.new end + def assessor_verify_failed_qualification_request_page + @assessor_verify_failed_qualification_request_page ||= + PageObjects::AssessorInterface::VerifyFailedQualificationRequest.new + end + def assessor_verify_failed_reference_request_page @assessor_verify_failed_reference_request_page ||= PageObjects::AssessorInterface::VerifyFailedReferenceRequest.new @@ -280,6 +280,11 @@ def assessor_verify_professional_standing_request_page PageObjects::AssessorInterface::VerifyProfessionalStandingRequest.new end + def assessor_verify_qualification_request_page + @assessor_verify_qualification_request_page ||= + PageObjects::AssessorInterface::VerifyQualificationRequest.new + end + def assessor_verify_qualifications_assessment_recommendation_verify_page @assessor_verify_qualifications_assessment_recommendation_verify_page ||= PageObjects::AssessorInterface::VerifyQualificationsAssessmentRecommendationVerify.new diff --git a/spec/system/assessor_interface/verifying_qualifications_spec.rb b/spec/system/assessor_interface/verifying_qualifications_spec.rb index 7f32e3bf21..ab04471125 100644 --- a/spec/system/assessor_interface/verifying_qualifications_spec.rb +++ b/spec/system/assessor_interface/verifying_qualifications_spec.rb @@ -115,6 +115,34 @@ then_i_see_the(:assessor_application_page, reference:) end + it "ecctis received" do + given_the_admin_has_accepted_the_consent_requests + given_the_admin_has_requested_the_qualification_requests + + when_i_visit_the(:assessor_application_page, reference:) + and_i_click_the_verify_qualifications_task + then_i_see_the(:assessor_qualification_requests_page, reference:) + and_the_request_ecctis_verification_task_is_completed + and_the_record_ecctis_response_task_is_waiting_on + + when_i_click_the_record_ecctis_response_task + then_i_see_the(:assessor_verify_qualification_request_page) + and_i_submit_yes_on_the_verify_form + then_i_see_the(:assessor_qualification_requests_page, reference:) + and_the_record_ecctis_response_task_is_completed + + when_i_click_the_record_ecctis_response_task + then_i_see_the(:assessor_verify_qualification_request_page) + and_i_submit_no_on_the_verify_form + then_i_see_the(:assessor_verify_failed_qualification_request_page) + and_i_submit_an_internal_note + then_i_see_the(:assessor_qualification_requests_page, reference:) + and_the_record_ecctis_response_task_is_review + + when_i_go_back_to_overview + then_i_see_the(:assessor_application_page, reference:) + end + private def given_there_is_an_application_form_with_qualification_request @@ -134,6 +162,10 @@ def given_the_admin_has_accepted_the_consent_requests assessment.qualification_requests.each(&:consent_method_unsigned!) end + def given_the_admin_has_requested_the_qualification_requests + assessment.qualification_requests.each(&:requested!) + end + def and_i_click_the_verify_qualifications_task assessor_application_page.verify_qualifications_task.link.click end @@ -302,6 +334,30 @@ def and_the_record_ecctis_response_task_is_waiting_on expect(record_ecctis_response_task_item.status_tag.text).to eq("WAITING ON") end + def when_i_click_the_record_ecctis_response_task + record_ecctis_response_task_item.click + end + + def and_i_submit_yes_on_the_verify_form + assessor_verify_qualification_request_page.submit_yes + end + + def and_the_record_ecctis_response_task_is_completed + expect(record_ecctis_response_task_item.status_tag.text).to eq("COMPLETED") + end + + def and_i_submit_no_on_the_verify_form + assessor_verify_qualification_request_page.submit_no + end + + def and_i_submit_an_internal_note + assessor_verify_failed_qualification_request_page.submit(note: "A note.") + end + + def and_the_record_ecctis_response_task_is_review + expect(record_ecctis_response_task_item.status_tag.text).to eq("REVIEW") + end + def when_i_go_back_to_overview assessor_qualification_requests_page.continue_button.click end diff --git a/spec/view_objects/assessor_interface/qualification_requests_view_object_spec.rb b/spec/view_objects/assessor_interface/qualification_requests_view_object_spec.rb index 95e695b2ba..7e64b2a5ad 100644 --- a/spec/view_objects/assessor_interface/qualification_requests_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/qualification_requests_view_object_spec.rb @@ -77,7 +77,7 @@ }, { name: "Record Ecctis response", - link: "#", + link: nil, status: "cannot_start", }, ], @@ -139,7 +139,7 @@ }, { name: "Record Ecctis response", - link: "#", + link: nil, status: "cannot_start", }, ], @@ -185,7 +185,7 @@ }, { name: "Record Ecctis response", - link: "#", + link: nil, status: "cannot_start", }, ],