diff --git a/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb index 9df33e9183..6a55d14d5c 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_award_controller.rb @@ -121,7 +121,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:assessment_id]) end diff --git a/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb index 2fc28b1f77..c38ce379f1 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_decline_controller.rb @@ -94,7 +94,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:assessment_id]) end diff --git a/app/controllers/assessor_interface/assessment_recommendation_review_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_review_controller.rb index 7039be4b72..d8aa379e33 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_review_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_review_controller.rb @@ -34,7 +34,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:assessment_id]) end diff --git a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb index 1a12e36f7d..ef63c5f56d 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb @@ -220,7 +220,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:assessment_id]) end diff --git a/app/controllers/assessor_interface/assessments_controller.rb b/app/controllers/assessor_interface/assessments_controller.rb index afd93583fe..85a2245abd 100644 --- a/app/controllers/assessor_interface/assessments_controller.rb +++ b/app/controllers/assessor_interface/assessments_controller.rb @@ -54,7 +54,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:id]) end diff --git a/app/controllers/assessor_interface/assessor_assignments_controller.rb b/app/controllers/assessor_interface/assessor_assignments_controller.rb index 5fa36e9ef6..bf086d8bbb 100644 --- a/app/controllers/assessor_interface/assessor_assignments_controller.rb +++ b/app/controllers/assessor_interface/assessor_assignments_controller.rb @@ -30,7 +30,8 @@ def create private def application_form - @application_form ||= ApplicationForm.find(params[:application_form_id]) + @application_form ||= + ApplicationForm.find_by!(reference: params[:application_form_reference]) end def assessor_params diff --git a/app/controllers/assessor_interface/further_information_requests_controller.rb b/app/controllers/assessor_interface/further_information_requests_controller.rb index f999c91ba3..1f3debec35 100644 --- a/app/controllers/assessor_interface/further_information_requests_controller.rb +++ b/app/controllers/assessor_interface/further_information_requests_controller.rb @@ -105,7 +105,7 @@ def application_form @application_form ||= ApplicationForm.includes( assessment: :further_information_requests, - ).find(params[:application_form_id]) + ).find_by(reference: params[:application_form_reference]) end def view_object diff --git a/app/controllers/assessor_interface/notes_controller.rb b/app/controllers/assessor_interface/notes_controller.rb index 7ad5fbd3c9..1a0e47327c 100644 --- a/app/controllers/assessor_interface/notes_controller.rb +++ b/app/controllers/assessor_interface/notes_controller.rb @@ -27,7 +27,8 @@ def create private def application_form - @application_form ||= ApplicationForm.find(params[:application_form_id]) + @application_form ||= + ApplicationForm.find_by!(reference: params[:application_form_reference]) end def author diff --git a/app/controllers/assessor_interface/professional_standing_requests_controller.rb b/app/controllers/assessor_interface/professional_standing_requests_controller.rb index 06d223f76e..0850426e36 100644 --- a/app/controllers/assessor_interface/professional_standing_requests_controller.rb +++ b/app/controllers/assessor_interface/professional_standing_requests_controller.rb @@ -198,8 +198,8 @@ def professional_standing_request assessment: :application_form, ).find_by( assessment_id: params[:assessment_id], - assessment: { - application_form_id: params[:application_form_id], + application_form: { + reference: params[:application_form_reference], }, ) end diff --git a/app/controllers/assessor_interface/qualification_requests_controller.rb b/app/controllers/assessor_interface/qualification_requests_controller.rb index 9db79d0df7..f00cf91f59 100644 --- a/app/controllers/assessor_interface/qualification_requests_controller.rb +++ b/app/controllers/assessor_interface/qualification_requests_controller.rb @@ -86,8 +86,8 @@ def qualification_requests .includes(:qualification) .where( assessment_id: params[:assessment_id], - assessment: { - application_form_id: params[:application_form_id], + application_form: { + reference: params[:application_form_reference], }, ) .order("qualifications.start_date": :desc) diff --git a/app/controllers/assessor_interface/reference_requests_controller.rb b/app/controllers/assessor_interface/reference_requests_controller.rb index 8df3607266..f98faabd3b 100644 --- a/app/controllers/assessor_interface/reference_requests_controller.rb +++ b/app/controllers/assessor_interface/reference_requests_controller.rb @@ -90,8 +90,8 @@ def reference_requests .includes(:work_history) .where( assessment_id: params[:assessment_id], - assessment: { - application_form_id: params[:application_form_id], + application_form: { + reference: params[:application_form_reference], }, ) .order("work_histories.start_date": :desc) diff --git a/app/controllers/assessor_interface/review_verifications_controller.rb b/app/controllers/assessor_interface/review_verifications_controller.rb index 786f1c6f56..e27caccfe1 100644 --- a/app/controllers/assessor_interface/review_verifications_controller.rb +++ b/app/controllers/assessor_interface/review_verifications_controller.rb @@ -20,7 +20,11 @@ def assessment @assessment ||= Assessment .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:assessment_id]) end end diff --git a/app/controllers/assessor_interface/reviewer_assignments_controller.rb b/app/controllers/assessor_interface/reviewer_assignments_controller.rb index 0e063bc194..a5961d5507 100644 --- a/app/controllers/assessor_interface/reviewer_assignments_controller.rb +++ b/app/controllers/assessor_interface/reviewer_assignments_controller.rb @@ -30,7 +30,8 @@ def create private def application_form - @application_form ||= ApplicationForm.find(params[:application_form_id]) + @application_form ||= + ApplicationForm.find_by!(reference: params[:application_form_reference]) end def reviewer_params diff --git a/app/controllers/assessor_interface/timeline_events_controller.rb b/app/controllers/assessor_interface/timeline_events_controller.rb index c47d2e3e13..ddb6ec6f2f 100644 --- a/app/controllers/assessor_interface/timeline_events_controller.rb +++ b/app/controllers/assessor_interface/timeline_events_controller.rb @@ -5,7 +5,8 @@ class TimelineEventsController < BaseController before_action :authorize_assessor def index - @application_form = ApplicationForm.find(params[:application_form_id]) + @application_form = + ApplicationForm.find_by!(reference: params[:application_form_reference]) @timeline_events = TimelineEvent diff --git a/app/controllers/assessor_interface/work_histories_controller.rb b/app/controllers/assessor_interface/work_histories_controller.rb index d69b2b5de5..808367ac8a 100644 --- a/app/controllers/assessor_interface/work_histories_controller.rb +++ b/app/controllers/assessor_interface/work_histories_controller.rb @@ -36,7 +36,11 @@ def work_history @work_history ||= WorkHistory .includes(:application_form) - .where(application_form_id: params[:application_form_id]) + .where( + application_form: { + reference: params[:application_form_reference], + }, + ) .find(params[:id]) end diff --git a/app/jobs/update_working_days_job.rb b/app/jobs/update_working_days_job.rb index 59b5d4a426..c5dca99135 100644 --- a/app/jobs/update_working_days_job.rb +++ b/app/jobs/update_working_days_job.rb @@ -68,7 +68,7 @@ def update_assessments_submission_to_recommendation Assessment .joins(:application_form) .includes(:application_form) - .where.not(application_forms: { submitted_at: nil }) + .where.not(application_form: { submitted_at: nil }) .where.not(recommended_at: nil) .find_each do |assessment| assessment.update!( @@ -85,7 +85,7 @@ def update_assessments_submission_to_started Assessment .joins(:application_form) .includes(:application_form) - .where.not(application_forms: { submitted_at: nil }) + .where.not(application_form: { submitted_at: nil }) .where.not(started_at: nil) .find_each do |assessment| assessment.update!( diff --git a/app/models/application_form.rb b/app/models/application_form.rb index e7d79622ec..b46cf5e5f1 100644 --- a/app/models/application_form.rb +++ b/app/models/application_form.rb @@ -221,6 +221,10 @@ class ApplicationForm < ApplicationRecord scope :remindable, -> { draft.where("created_at < ?", 5.months.ago) } + def to_param + reference + end + def teaching_qualification qualifications.find(&:is_teaching_qualification?) end diff --git a/app/view_objects/assessor_interface/application_forms_show_view_object.rb b/app/view_objects/assessor_interface/application_forms_show_view_object.rb index 209b477f84..ed03198e6d 100644 --- a/app/view_objects/assessor_interface/application_forms_show_view_object.rb +++ b/app/view_objects/assessor_interface/application_forms_show_view_object.rb @@ -11,7 +11,7 @@ def application_form ApplicationForm .includes(assessment: :sections) .not_draft - .find(params[:id]) + .find_by!(reference: params[:reference]) end def duplicate_matches diff --git a/app/view_objects/assessor_interface/assessment_section_view_object.rb b/app/view_objects/assessor_interface/assessment_section_view_object.rb index ae5e8a9f00..2ff125f9e7 100644 --- a/app/view_objects/assessor_interface/assessment_section_view_object.rb +++ b/app/view_objects/assessor_interface/assessment_section_view_object.rb @@ -17,8 +17,8 @@ def assessment_section ).find_by!( id: params[:id], assessment_id: params[:assessment_id], - assessment: { - application_form_id: params[:application_form_id], + application_form: { + reference: params[:application_form_reference], }, ) end diff --git a/app/view_objects/assessor_interface/further_information_request_view_object.rb b/app/view_objects/assessor_interface/further_information_request_view_object.rb index e00ff98bbf..ab89fa4d85 100644 --- a/app/view_objects/assessor_interface/further_information_request_view_object.rb +++ b/app/view_objects/assessor_interface/further_information_request_view_object.rb @@ -12,8 +12,8 @@ def further_information_request .received .where( assessment_id: params[:assessment_id], - assessment: { - application_form_id: params[:application_form_id], + application_form: { + reference: params[:application_form_reference], }, ) .find(params[:id]) diff --git a/config/routes.rb b/config/routes.rb index abe94b57da..8a573c458c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,7 +14,10 @@ namespace :assessor_interface, path: "/assessor" do root to: redirect("/assessor/applications") - resources :application_forms, path: "/applications", except: :new do + resources :application_forms, + path: "/applications", + except: :new, + param: :reference do collection do post "filters/apply", to: "application_forms#apply_filters" get "filters/clear", to: "application_forms#clear_filters" diff --git a/spec/components/application_form_search_result_component_spec.rb b/spec/components/application_form_search_result_component_spec.rb index 8a525c7a08..3f8fbf93a3 100644 --- a/spec/components/application_form_search_result_component_spec.rb +++ b/spec/components/application_form_search_result_component_spec.rb @@ -27,7 +27,9 @@ describe "heading link" do subject(:href) { component.at_css("h2 > a")["href"] } - it { is_expected.to eq("/assessor/applications/#{application_form.id}") } + it do + is_expected.to eq("/assessor/applications/#{application_form.reference}") + end end describe "description list" do diff --git a/spec/models/application_form_spec.rb b/spec/models/application_form_spec.rb index d205a85e7d..9d0f870cfc 100644 --- a/spec/models/application_form_spec.rb +++ b/spec/models/application_form_spec.rb @@ -446,6 +446,11 @@ expect(application_form.written_statement_document).to_not be_nil end + describe "#to_param" do + subject(:to_param) { application_form.to_param } + it { is_expected.to eq(application_form.reference) } + end + describe "#created_under_new_regulations?" do subject(:created_under_new_regulations?) do application_form.created_under_new_regulations? 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 f4befa438f..622c8a726a 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 @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class AgeRangeSubjectsAssessmentRecommendationAward < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/award/age-range-subjects" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/application.rb b/spec/support/autoload/page_objects/assessor_interface/application.rb index a9414870ca..7d0f2ff200 100644 --- a/spec/support/autoload/page_objects/assessor_interface/application.rb +++ b/spec/support/autoload/page_objects/assessor_interface/application.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class Application < SitePrism::Page - set_url "/assessor/applications/{application_form_id}" + set_url "/assessor/applications/{reference}" element :back_link, "a", text: "Back" diff --git a/spec/support/autoload/page_objects/assessor_interface/application_status.rb b/spec/support/autoload/page_objects/assessor_interface/application_status.rb index 27b6a28fad..b73e0dc519 100644 --- a/spec/support/autoload/page_objects/assessor_interface/application_status.rb +++ b/spec/support/autoload/page_objects/assessor_interface/application_status.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class ApplicationStatus < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/status" + set_url "/assessor/applications/{reference}/status" element :back_link, "a", text: "Back" diff --git a/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_review.rb b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_review.rb index 9651d47fd5..803f5d4239 100644 --- a/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_review.rb +++ b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_review.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class AssessmentRecommendationReview < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/review/edit" element :continue_button, ".govuk-button" diff --git a/spec/support/autoload/page_objects/assessor_interface/assessment_section.rb b/spec/support/autoload/page_objects/assessor_interface/assessment_section.rb index c1538bf85f..6dcec56b0c 100644 --- a/spec/support/autoload/page_objects/assessor_interface/assessment_section.rb +++ b/spec/support/autoload/page_objects/assessor_interface/assessment_section.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class AssessmentSection < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/assign_assessor.rb b/spec/support/autoload/page_objects/assessor_interface/assign_assessor.rb index 719bbda4a2..69ba3287a0 100644 --- a/spec/support/autoload/page_objects/assessor_interface/assign_assessor.rb +++ b/spec/support/autoload/page_objects/assessor_interface/assign_assessor.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class AssignAssessor < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assign-assessor" + set_url "/assessor/applications/{reference}/assign-assessor" element :heading, "h1" sections :assessors, PageObjects::GovukRadioItem, ".govuk-radios__item" diff --git a/spec/support/autoload/page_objects/assessor_interface/assign_reviewer.rb b/spec/support/autoload/page_objects/assessor_interface/assign_reviewer.rb index e258bfcfc7..f44b5e07f8 100644 --- a/spec/support/autoload/page_objects/assessor_interface/assign_reviewer.rb +++ b/spec/support/autoload/page_objects/assessor_interface/assign_reviewer.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class AssignReviewer < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assign-reviewer" + set_url "/assessor/applications/{reference}/assign-reviewer" element :heading, "h1" sections :reviewers, PageObjects::GovukRadioItem, ".govuk-radios__item" diff --git a/spec/support/autoload/page_objects/assessor_interface/check_english_language_proficiency.rb b/spec/support/autoload/page_objects/assessor_interface/check_english_language_proficiency.rb index 3f291e34fe..2decdf1702 100644 --- a/spec/support/autoload/page_objects/assessor_interface/check_english_language_proficiency.rb +++ b/spec/support/autoload/page_objects/assessor_interface/check_english_language_proficiency.rb @@ -5,7 +5,7 @@ class EnglishLanguageProficiencyCard < SitePrism::Section end class CheckEnglishLanguageProficiency < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, EnglishLanguageProficiencyCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/check_personal_information.rb b/spec/support/autoload/page_objects/assessor_interface/check_personal_information.rb index d4e31da976..18ddbb5cc5 100644 --- a/spec/support/autoload/page_objects/assessor_interface/check_personal_information.rb +++ b/spec/support/autoload/page_objects/assessor_interface/check_personal_information.rb @@ -9,7 +9,7 @@ class PersonalInformationCard < SitePrism::Section end class CheckPersonalInformation < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, PersonalInformationCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/check_professional_standing.rb b/spec/support/autoload/page_objects/assessor_interface/check_professional_standing.rb index 7b3a328992..f3f7241242 100644 --- a/spec/support/autoload/page_objects/assessor_interface/check_professional_standing.rb +++ b/spec/support/autoload/page_objects/assessor_interface/check_professional_standing.rb @@ -7,7 +7,7 @@ class ProfessionalStandingCard < SitePrism::Section end class CheckProfessionalStanding < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, ProfessionalStandingCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/check_qualifications.rb b/spec/support/autoload/page_objects/assessor_interface/check_qualifications.rb index cc04649bb6..c4c193898a 100644 --- a/spec/support/autoload/page_objects/assessor_interface/check_qualifications.rb +++ b/spec/support/autoload/page_objects/assessor_interface/check_qualifications.rb @@ -7,7 +7,7 @@ class QualificationCard < SitePrism::Section end class CheckQualifications < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, QualificationCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/check_work_history.rb b/spec/support/autoload/page_objects/assessor_interface/check_work_history.rb index 8e140cbec7..c140e958a2 100644 --- a/spec/support/autoload/page_objects/assessor_interface/check_work_history.rb +++ b/spec/support/autoload/page_objects/assessor_interface/check_work_history.rb @@ -7,7 +7,7 @@ class WorkHistoryCard < GovukSummaryCard end class CheckWorkHistory < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, WorkHistoryCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb b/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb index 4d48689a6b..a780a9d9c8 100644 --- a/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb +++ b/spec/support/autoload/page_objects/assessor_interface/complete_assessment.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class CompleteAssessment < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/edit" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/edit" element :heading, "h1" sections :new_states, GovukRadioItem, ".govuk-radios__item" diff --git a/spec/support/autoload/page_objects/assessor_interface/confirm_assessment_recommendation.rb b/spec/support/autoload/page_objects/assessor_interface/confirm_assessment_recommendation.rb index e2493b6406..2374579583 100644 --- a/spec/support/autoload/page_objects/assessor_interface/confirm_assessment_recommendation.rb +++ b/spec/support/autoload/page_objects/assessor_interface/confirm_assessment_recommendation.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class ConfirmAssessmentRecommendation < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/{recommendation}/confirm" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/contact_professional_standing_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/contact_professional_standing_assessment_recommendation_verify.rb index c31e872b4f..a64b7135a1 100644 --- a/spec/support/autoload/page_objects/assessor_interface/contact_professional_standing_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/contact_professional_standing_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ContactProfessionalStandingAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/contact-professional-standing" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/create_note.rb b/spec/support/autoload/page_objects/assessor_interface/create_note.rb index 79ea6501fe..a874e40672 100644 --- a/spec/support/autoload/page_objects/assessor_interface/create_note.rb +++ b/spec/support/autoload/page_objects/assessor_interface/create_note.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class CreateNote < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/notes/new" + set_url "/assessor/applications/{reference}/notes/new" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/declare_assessment_recommendation.rb b/spec/support/autoload/page_objects/assessor_interface/declare_assessment_recommendation.rb index ea0e959937..4e16fff091 100644 --- a/spec/support/autoload/page_objects/assessor_interface/declare_assessment_recommendation.rb +++ b/spec/support/autoload/page_objects/assessor_interface/declare_assessment_recommendation.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class DeclareAssessmentRecommendation < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/{recommendation}/edit" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/edit_age_range_subjects_assessment_recommendation_award.rb b/spec/support/autoload/page_objects/assessor_interface/edit_age_range_subjects_assessment_recommendation_award.rb index 48ae88edc4..6cf41be24b 100644 --- a/spec/support/autoload/page_objects/assessor_interface/edit_age_range_subjects_assessment_recommendation_award.rb +++ b/spec/support/autoload/page_objects/assessor_interface/edit_age_range_subjects_assessment_recommendation_award.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EditAgeRangeSubjectsAssessmentRecommendationAward < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/award/age-range-subjects/edit" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/edit_application.rb b/spec/support/autoload/page_objects/assessor_interface/edit_application.rb index a690df1cd8..aaa97964b1 100644 --- a/spec/support/autoload/page_objects/assessor_interface/edit_application.rb +++ b/spec/support/autoload/page_objects/assessor_interface/edit_application.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EditApplication < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/edit" + set_url "/assessor/applications/{reference}/edit" section :form, "form" do element :given_names_field, 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 index 32f6624800..409bf502d9 100644 --- a/spec/support/autoload/page_objects/assessor_interface/edit_qualification_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/edit_qualification_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EditQualificationRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/qualification-requests/{id}/edit" section :form, "form" do diff --git a/spec/support/autoload/page_objects/assessor_interface/edit_reference_request.rb b/spec/support/autoload/page_objects/assessor_interface/edit_reference_request.rb index 4b1d00b905..6728833fb5 100644 --- a/spec/support/autoload/page_objects/assessor_interface/edit_reference_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/edit_reference_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EditReferenceRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/reference-requests/{id}/edit" section :summary_list, GovukSummaryList, "#reference-details-summary-list" diff --git a/spec/support/autoload/page_objects/assessor_interface/edit_work_history.rb b/spec/support/autoload/page_objects/assessor_interface/edit_work_history.rb index c2f3984871..fcbf549075 100644 --- a/spec/support/autoload/page_objects/assessor_interface/edit_work_history.rb +++ b/spec/support/autoload/page_objects/assessor_interface/edit_work_history.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EditWorkHistory < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/work-histories/{work_history_id}/edit" + set_url "/assessor/applications/{reference}/work-histories/{work_history_id}/edit" section :form, "form" do element :name_field, diff --git a/spec/support/autoload/page_objects/assessor_interface/email_consent_letters_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/email_consent_letters_assessment_recommendation_verify.rb index 31ea41880a..99c03bb9c9 100644 --- a/spec/support/autoload/page_objects/assessor_interface/email_consent_letters_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/email_consent_letters_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class EmailConsentLettersAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/email-consent-letters" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/further_information_request.rb b/spec/support/autoload/page_objects/assessor_interface/further_information_request.rb index 61209709e8..4b2a2d40f0 100644 --- a/spec/support/autoload/page_objects/assessor_interface/further_information_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/further_information_request.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class FurtherInformationRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/further-information-requests/{further_information_request_id}" 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 index fa15457094..36993df526 100644 --- 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 @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class FurtherInformationRequestPreview < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/further-information-requests/new" element :email_preview, "div.app-email-preview" diff --git a/spec/support/autoload/page_objects/assessor_interface/locate_professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/locate_professional_standing_request.rb index e764c946e3..03e425b0db 100644 --- a/spec/support/autoload/page_objects/assessor_interface/locate_professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/locate_professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class LocateProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request/locate" section :form, "form" do 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 index dbbc515423..1eb4369aa2 100644 --- a/spec/support/autoload/page_objects/assessor_interface/preview_assessment_recommendation.rb +++ b/spec/support/autoload/page_objects/assessor_interface/preview_assessment_recommendation.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class PreviewAssessmentRecommendation < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/{recommendation}/preview" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/preview_referee_assessment_recommendation_award.rb b/spec/support/autoload/page_objects/assessor_interface/preview_referee_assessment_recommendation_award.rb index dcbeb380da..c14077b1a1 100644 --- a/spec/support/autoload/page_objects/assessor_interface/preview_referee_assessment_recommendation_award.rb +++ b/spec/support/autoload/page_objects/assessor_interface/preview_referee_assessment_recommendation_award.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class PreviewRefereeAssessmentRecommendationAward < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/preview-referee" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/preview_teacher_assessment_recommendation_award.rb b/spec/support/autoload/page_objects/assessor_interface/preview_teacher_assessment_recommendation_award.rb index 890ec8db06..81b30f2ae6 100644 --- a/spec/support/autoload/page_objects/assessor_interface/preview_teacher_assessment_recommendation_award.rb +++ b/spec/support/autoload/page_objects/assessor_interface/preview_teacher_assessment_recommendation_award.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class PreviewTeacherAssessmentRecommendationAward < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/preview-teacher" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/professional_standing_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/professional_standing_assessment_recommendation_verify.rb index 39c100ca29..183c17dfd5 100644 --- a/spec/support/autoload/page_objects/assessor_interface/professional_standing_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/professional_standing_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ProfessionalStandingAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/professional-standing" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/professional_standing_request.rb index d6dbb1ff71..c8c2af925b 100644 --- a/spec/support/autoload/page_objects/assessor_interface/professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request" section :task_list, TaskList, ".app-task-list" diff --git a/spec/support/autoload/page_objects/assessor_interface/qualification_requests.rb b/spec/support/autoload/page_objects/assessor_interface/qualification_requests.rb index d1443d9f7a..9972942a15 100644 --- a/spec/support/autoload/page_objects/assessor_interface/qualification_requests.rb +++ b/spec/support/autoload/page_objects/assessor_interface/qualification_requests.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class QualificationRequests < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/qualification-requests" section :task_list, ".app-task-list__item" do diff --git a/spec/support/autoload/page_objects/assessor_interface/qualification_requests_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/qualification_requests_assessment_recommendation_verify.rb index 805bb9cf57..e1ed3d7e4e 100644 --- a/spec/support/autoload/page_objects/assessor_interface/qualification_requests_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/qualification_requests_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class QualificationRequestsAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/qualification-requests" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/reference_requests.rb b/spec/support/autoload/page_objects/assessor_interface/reference_requests.rb index 642d18ed51..0c55b68000 100644 --- a/spec/support/autoload/page_objects/assessor_interface/reference_requests.rb +++ b/spec/support/autoload/page_objects/assessor_interface/reference_requests.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ReferenceRequests < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/reference-requests" section :task_list, ".app-task-list__item" do diff --git a/spec/support/autoload/page_objects/assessor_interface/reference_requests_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/reference_requests_assessment_recommendation_verify.rb index f9cef2cdac..887f68a71f 100644 --- a/spec/support/autoload/page_objects/assessor_interface/reference_requests_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/reference_requests_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ReferenceRequestsAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/reference-requests" element :heading, "h1" 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 4ee29e6a80..eb490f5079 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,7 +1,7 @@ module PageObjects module AssessorInterface class RequestFurtherInformation < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/further-information-requests/preview" sections :items, ".app-further-information-request-item" do diff --git a/spec/support/autoload/page_objects/assessor_interface/request_professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/request_professional_standing_request.rb index 01e1bd6e4a..a094f5acf5 100644 --- a/spec/support/autoload/page_objects/assessor_interface/request_professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/request_professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class RequestProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request/request" section :form, "form" do diff --git a/spec/support/autoload/page_objects/assessor_interface/reverse_decision.rb b/spec/support/autoload/page_objects/assessor_interface/reverse_decision.rb index dde7f2a74d..193fe8c391 100644 --- a/spec/support/autoload/page_objects/assessor_interface/reverse_decision.rb +++ b/spec/support/autoload/page_objects/assessor_interface/reverse_decision.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ReverseDecision < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/rollback" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/rollback" section :form, "form" do element :submit_button, ".govuk-button:not(.govuk-button--secondary)" diff --git a/spec/support/autoload/page_objects/assessor_interface/review_further_information_request.rb b/spec/support/autoload/page_objects/assessor_interface/review_further_information_request.rb index b8a4d9831a..0495096263 100644 --- a/spec/support/autoload/page_objects/assessor_interface/review_further_information_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/review_further_information_request.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class ReviewFurtherInformationRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/further-information-requests/{further_information_request_id}/edit" element :heading, ".govuk-heading-xl" diff --git a/spec/support/autoload/page_objects/assessor_interface/review_professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/review_professional_standing_request.rb index 0ca1663c95..312690428a 100644 --- a/spec/support/autoload/page_objects/assessor_interface/review_professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/review_professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ReviewProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request/review" section :form, "form" do diff --git a/spec/support/autoload/page_objects/assessor_interface/review_verifications.rb b/spec/support/autoload/page_objects/assessor_interface/review_verifications.rb index 18f75cd782..dc7a3bdea7 100644 --- a/spec/support/autoload/page_objects/assessor_interface/review_verifications.rb +++ b/spec/support/autoload/page_objects/assessor_interface/review_verifications.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class ReviewVerifications < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/review-verifications" section :task_list, TaskList, ".app-task-list" diff --git a/spec/support/autoload/page_objects/assessor_interface/timeline.rb b/spec/support/autoload/page_objects/assessor_interface/timeline.rb index 80a85bef82..e9433e5b9b 100644 --- a/spec/support/autoload/page_objects/assessor_interface/timeline.rb +++ b/spec/support/autoload/page_objects/assessor_interface/timeline.rb @@ -1,7 +1,7 @@ module PageObjects module AssessorInterface class Timeline < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/timeline_events" + set_url "/assessor/applications/{reference}/timeline_events" element :heading, "h1" sections :timeline_items, MojTimelineItem, ".moj-timeline__item" diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_age_range_subjects_page.rb b/spec/support/autoload/page_objects/assessor_interface/verify_age_range_subjects_page.rb index 698008e192..9d0973e85c 100644 --- a/spec/support/autoload/page_objects/assessor_interface/verify_age_range_subjects_page.rb +++ b/spec/support/autoload/page_objects/assessor_interface/verify_age_range_subjects_page.rb @@ -7,7 +7,7 @@ class AgeRangeSubjectCard < SitePrism::Section end class VerifyAgeRangeSubjectsPage < AssessmentSection - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}/sections/{section_id}" + set_url "/assessor/applications/{reference}/assessments/{assessment_id}/sections/{section_id}" sections :cards, AgeRangeSubjectCard, ".govuk-summary-card" diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_failed_professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/verify_failed_professional_standing_request.rb index 24984a8995..e52f2a093d 100644 --- a/spec/support/autoload/page_objects/assessor_interface/verify_failed_professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/verify_failed_professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class VerifyFailedProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request/verify-failed" section :form, "form" do diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_professional_standing_request.rb b/spec/support/autoload/page_objects/assessor_interface/verify_professional_standing_request.rb index 456c76eea6..aa7cac1265 100644 --- a/spec/support/autoload/page_objects/assessor_interface/verify_professional_standing_request.rb +++ b/spec/support/autoload/page_objects/assessor_interface/verify_professional_standing_request.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class VerifyProfessionalStandingRequest < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/professional-standing-request/verify" section :form, "form" do diff --git a/spec/support/autoload/page_objects/assessor_interface/verify_qualifications_assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/verify_qualifications_assessment_recommendation_verify.rb index 2c01a5dbf9..7bf622a396 100644 --- a/spec/support/autoload/page_objects/assessor_interface/verify_qualifications_assessment_recommendation_verify.rb +++ b/spec/support/autoload/page_objects/assessor_interface/verify_qualifications_assessment_recommendation_verify.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class VerifyQualificationsAssessmentRecommendationVerify < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ "/recommendation/verify/verify-qualifications" element :heading, "h1" diff --git a/spec/support/autoload/page_objects/assessor_interface/withdraw_application.rb b/spec/support/autoload/page_objects/assessor_interface/withdraw_application.rb index 9652c1442d..27df2854a6 100644 --- a/spec/support/autoload/page_objects/assessor_interface/withdraw_application.rb +++ b/spec/support/autoload/page_objects/assessor_interface/withdraw_application.rb @@ -3,7 +3,7 @@ module PageObjects module AssessorInterface class WithdrawApplication < SitePrism::Page - set_url "/assessor/applications/{application_form_id}/withdraw" + set_url "/assessor/applications/{reference}/withdraw" section :form, "form" do element :submit_button, ".govuk-button:not(.govuk-button--secondary)" diff --git a/spec/support/autoload/page_objects/teacher_interface/check_uploaded_files.rb b/spec/support/autoload/page_objects/teacher_interface/check_uploaded_files.rb index e758ffdc74..b157ca229d 100644 --- a/spec/support/autoload/page_objects/teacher_interface/check_uploaded_files.rb +++ b/spec/support/autoload/page_objects/teacher_interface/check_uploaded_files.rb @@ -1,7 +1,7 @@ module PageObjects module TeacherInterface class CheckUploadedFiles < SitePrism::Page - set_url "/teacher/application/documents/{application_form_id}/edit" + set_url "/teacher/application/documents/{reference}/edit" element :heading, "h1" element :files, ".govuk-grid-row .govuk-grid-column-two-thirds" diff --git a/spec/support/autoload/page_objects/teacher_interface/document_available.rb b/spec/support/autoload/page_objects/teacher_interface/document_available.rb index 8dcc172352..4c5208ae94 100644 --- a/spec/support/autoload/page_objects/teacher_interface/document_available.rb +++ b/spec/support/autoload/page_objects/teacher_interface/document_available.rb @@ -3,7 +3,7 @@ module PageObjects module TeacherInterface class DocumentAvailable < SitePrism::Page - set_url "/teacher/application/documents/{application_form_id}/edit" + set_url "/teacher/application/documents/{reference}/edit" element :heading, "h1" diff --git a/spec/system/assessor_interface/assigning_assessor_spec.rb b/spec/system/assessor_interface/assigning_assessor_spec.rb index e22501771f..95b30e2562 100644 --- a/spec/system/assessor_interface/assigning_assessor_spec.rb +++ b/spec/system/assessor_interface/assigning_assessor_spec.rb @@ -11,40 +11,25 @@ it "assigns an assessor" do given_i_am_authorized_as_an_assessor_user - when_i_visit_the( - :assessor_assign_assessor_page, - application_form_id: application_form.id, - ) + when_i_visit_the(:assessor_assign_assessor_page, reference:) and_i_select_an_assessor - then_i_see_the( - :assessor_application_page, - application_form_id: application_form.id, - ) + then_i_see_the(:assessor_application_page, reference:) and_the_assessor_is_assigned_to_the_application_form end it "assigns a reviewer" do given_i_am_authorized_as_an_assessor_user - when_i_visit_the( - :assessor_assign_reviewer_page, - application_form_id: application_form.id, - ) + when_i_visit_the(:assessor_assign_reviewer_page, reference:) and_i_select_a_reviewer - then_i_see_the( - :assessor_application_page, - application_form_id: application_form.id, - ) + then_i_see_the(:assessor_application_page, reference:) and_the_assessor_is_assigned_as_reviewer_to_the_application_form end it "requires permission" do given_i_am_authorized_as_a_support_user - when_i_visit_the( - :assessor_assign_assessor_page, - application_form_id: application_form.id, - ) + when_i_visit_the(:assessor_assign_assessor_page, reference:) then_i_see_the_forbidden_page end @@ -65,10 +50,6 @@ def and_the_assessor_is_assigned_to_the_application_form ) end - def when_i_visit_the_assign_reviewer_page - assessor_assign_reviewer_page.load(application_form_id: application_form.id) - end - def and_i_select_a_reviewer assessor_assign_reviewer_page.reviewers.second.input.click assessor_assign_reviewer_page.continue_button.click @@ -90,6 +71,8 @@ def application_form ) end + delegate :reference, to: :application_form + def assessor @user end diff --git a/spec/system/assessor_interface/change_application_form_name_spec.rb b/spec/system/assessor_interface/change_application_form_name_spec.rb index 391aaa434b..62337b76db 100644 --- a/spec/system/assessor_interface/change_application_form_name_spec.rb +++ b/spec/system/assessor_interface/change_application_form_name_spec.rb @@ -11,21 +11,21 @@ it "checks manage applications permission" do given_i_am_authorized_as_a_user(assessor) - when_i_visit_the(:assessor_edit_application_page, application_form_id:) + when_i_visit_the(:assessor_edit_application_page, reference:) then_i_see_the_forbidden_page end it "allows changing application form name" do given_i_am_authorized_as_a_user(manager) - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the(:assessor_application_page) when_i_click_on_change_name - then_i_see_the(:assessor_edit_application_page, application_form_id:) + then_i_see_the(:assessor_edit_application_page, reference:) when_i_fill_in_the_name - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) end def given_there_is_an_application_form @@ -59,7 +59,7 @@ def application_form ) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessor create(:staff, :confirmed, :with_assess_permission) diff --git a/spec/system/assessor_interface/change_work_history_spec.rb b/spec/system/assessor_interface/change_work_history_spec.rb index 574c7bbe0f..1f4a61fec2 100644 --- a/spec/system/assessor_interface/change_work_history_spec.rb +++ b/spec/system/assessor_interface/change_work_history_spec.rb @@ -13,7 +13,7 @@ when_i_visit_the( :assessor_edit_work_history_page, - application_form_id:, + reference:, work_history_id:, ) then_i_see_the_forbidden_page @@ -24,7 +24,7 @@ when_i_visit_the( :assessor_check_work_history_page, - application_form_id:, + reference:, assessment_id:, section_id: assessment_section.id, ) @@ -33,12 +33,12 @@ when_i_click_on_change_from_assessment then_i_see_the( :assessor_edit_work_history_page, - application_form_id:, + reference:, work_history_id:, ) when_i_fill_in_the_contact_information - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) end it "allows changing work history from verification" do @@ -46,7 +46,7 @@ when_i_visit_the( :assessor_edit_reference_request_page, - application_form_id:, + reference:, assessment_id:, id: reference_request.id, ) @@ -55,12 +55,12 @@ when_i_click_on_change_from_verification then_i_see_the( :assessor_edit_work_history_page, - application_form_id:, + reference:, work_history_id:, ) when_i_fill_in_the_contact_information - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) end def given_there_is_an_application_form @@ -99,7 +99,7 @@ def application_form create(:application_form, :submitted, :with_personal_information) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment @assessment ||= create(:assessment, application_form:) diff --git a/spec/system/assessor_interface/checking_submitted_details_spec.rb b/spec/system/assessor_interface/checking_submitted_details_spec.rb index fd7e5ecc96..69a1eb1beb 100644 --- a/spec/system/assessor_interface/checking_submitted_details_spec.rb +++ b/spec/system/assessor_interface/checking_submitted_details_spec.rb @@ -10,28 +10,28 @@ it "allows passing the personal information" do when_i_visit_the( :assessor_check_personal_information_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("personal_information"), ) then_i_see_the_personal_information when_i_choose_check_personal_information_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_personal_information_completed end it "allows failing the personal information" do when_i_visit_the( :assessor_check_personal_information_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("personal_information"), ) then_i_see_the_personal_information when_i_choose_check_personal_information_no - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_personal_information_completed end @@ -39,7 +39,7 @@ given_there_are_selected_failure_reasons("personal_information") when_i_visit_the( :assessor_check_personal_information_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("personal_information"), ) @@ -49,28 +49,28 @@ it "allows passing the qualifications" do when_i_visit_the( :assessor_check_qualifications_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("qualifications"), ) then_i_see_the_qualifications when_i_choose_check_qualifications_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_qualifications_completed end it "allows failing the qualifications" do when_i_visit_the( :assessor_check_qualifications_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("qualifications"), ) then_i_see_the_qualifications when_i_choose_check_qualifications_no - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_qualifications_completed end @@ -78,7 +78,7 @@ given_there_are_selected_failure_reasons("qualifications") when_i_visit_the( :assessor_check_qualifications_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("qualifications"), ) @@ -88,7 +88,7 @@ it "allows passing the age range and subjects" do when_i_visit_the( :assessor_verify_age_range_subjects_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("age_range_subjects"), ) @@ -97,14 +97,14 @@ when_i_fill_in_age_range and_i_fill_in_subjects and_i_choose_verify_age_range_subjects_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_verify_age_range_subjects_completed end it "allows failing the age range and subjects" do when_i_visit_the( :assessor_verify_age_range_subjects_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("age_range_subjects"), ) @@ -113,7 +113,7 @@ when_i_fill_in_age_range and_i_fill_in_subjects and_i_choose_verify_age_range_subjects_no - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_verify_age_range_subjects_completed end @@ -121,7 +121,7 @@ given_there_are_selected_failure_reasons("age_range_subjects") when_i_visit_the( :assessor_verify_age_range_subjects_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("age_range_subjects"), ) @@ -131,28 +131,28 @@ it "allows passing the work history" do when_i_visit_the( :assessor_check_work_history_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("work_history"), ) then_i_see_the_work_history when_i_choose_check_work_history_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_work_history_completed end it "allows failing the work history" do when_i_visit_the( :assessor_check_work_history_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("work_history"), ) then_i_see_the_work_history when_i_choose_check_work_history_no - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_work_history_completed end @@ -160,7 +160,7 @@ given_there_are_selected_failure_reasons("work_history") when_i_visit_the( :assessor_check_work_history_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("work_history"), ) @@ -170,28 +170,28 @@ it "allows passing the professional standing" do when_i_visit_the( :assessor_check_professional_standing_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("professional_standing"), ) then_i_see_the_professional_standing when_i_choose_check_professional_standing_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_professional_standing_completed end it "allows failing the professional standing" do when_i_visit_the( :assessor_check_professional_standing_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("professional_standing"), ) then_i_see_the_professional_standing when_i_choose_check_professional_standing_no - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_professional_standing_completed end @@ -200,7 +200,7 @@ when_i_visit_the( :assessor_check_professional_standing_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("professional_standing"), ) @@ -209,7 +209,7 @@ when_i_choose_full_registration and_i_choose_induction_not_required and_i_choose_check_professional_standing_yes - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_check_professional_standing_completed end @@ -217,7 +217,7 @@ given_there_are_selected_failure_reasons("professional_standing") when_i_visit_the( :assessor_check_professional_standing_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("professional_standing"), ) @@ -509,7 +509,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index 58b649a33e..21f18d069a 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -29,7 +29,7 @@ when_i_visit_the( :assessor_complete_assessment_page, - application_form_id:, + reference:, assessment_id:, ) @@ -37,7 +37,7 @@ and_i_click_continue then_i_see_the( :assessor_declare_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "award", ) @@ -61,7 +61,7 @@ then_i_see_the( :assessor_preview_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "award", ) @@ -69,13 +69,13 @@ when_i_send_the_email then_i_see_the( :assessor_confirm_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "award", ) when_i_check_confirmation - then_i_see_the(:assessor_application_status_page, application_form_id:) + then_i_see_the(:assessor_application_status_page, reference:) when_i_click_on_overview_button then_the_application_form_is_awarded @@ -88,7 +88,7 @@ when_i_visit_the( :assessor_complete_assessment_page, - application_form_id:, + reference:, assessment_id:, ) @@ -96,54 +96,54 @@ and_i_click_continue then_i_see_the( :assessor_verify_qualifications_assessment_recommendation_verify_page, - application_form_id:, + reference:, assessment_id:, ) when_i_select_yes_verify_qualifications then_i_see_the( :assessor_qualification_requests_assessment_recommendation_verify_page, - application_form_id:, + reference:, assessment_id:, ) when_i_select_the_qualifications then_i_see_the( :assessor_email_consent_letters_requests_assessment_recommendation_verify_page, - application_form_id:, + reference:, assessment_id:, ) when_i_click_continue_from_email_consent_letters then_i_see_the( :assessor_professional_standing_assessment_recommendation_verify_page, - application_form_id:, + reference:, assessment_id:, ) when_i_select_yes_verify_professional_standing then_i_see_the( :assessor_reference_requests_assessment_recommendation_verify_page, - application_form_id:, + reference:, assessment_id:, ) when_i_select_the_work_histories then_i_see_the( :assessor_preview_referee_assessment_recommendation_award_page, - application_form_id:, + reference:, assessment_id:, ) when_i_send_the_referee_email then_i_see_the( :assessor_preview_teacher_assessment_recommendation_award_page, - application_form_id:, + reference:, assessment_id:, ) when_i_send_the_teacher_email - then_i_see_the(:assessor_application_status_page, application_form_id:) + then_i_see_the(:assessor_application_status_page, reference:) when_i_click_on_overview_button then_the_application_form_is_waiting_on @@ -156,7 +156,7 @@ when_i_visit_the( :assessor_complete_assessment_page, - application_form_id:, + reference:, assessment_id:, ) @@ -164,7 +164,7 @@ and_i_click_continue then_i_see_the( :assessor_declare_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "decline", ) @@ -173,7 +173,7 @@ when_i_check_declaration then_i_see_the( :assessor_preview_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "decline", ) @@ -181,13 +181,13 @@ when_i_send_the_email then_i_see_the( :assessor_confirm_assessment_recommendation_page, - application_form_id:, + reference:, assessment_id:, recommendation: "decline", ) when_i_check_confirmation - then_i_see_the(:assessor_application_status_page, application_form_id:) + then_i_see_the(:assessor_application_status_page, reference:) when_i_click_on_overview_button then_the_application_form_is_declined @@ -410,7 +410,7 @@ def then_the_application_form_is_declined ) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb b/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb index fcd43d440c..6deafa4631 100644 --- a/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb +++ b/spec/system/assessor_interface/confirming_english_language_exemption_spec.rb @@ -7,12 +7,12 @@ and_the_application_states_english_language_exemption_by_citizenship given_i_am_authorized_as_an_assessor_user - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the_application when_i_visit_the( :assessor_check_english_language_proficiency_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("english_language_proficiency"), ) @@ -20,7 +20,7 @@ when_i_visit_the( :assessor_check_personal_information_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("personal_information"), ) @@ -44,12 +44,12 @@ and_the_application_states_english_language_exemption_by_qualification given_i_am_authorized_as_an_assessor_user - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the_application when_i_visit_the( :assessor_check_english_language_proficiency_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("english_language_proficiency"), ) @@ -57,7 +57,7 @@ when_i_visit_the( :assessor_check_qualifications_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("qualifications"), ) @@ -78,7 +78,7 @@ given_i_am_authorized_as_an_assessor_user when_i_visit_the( :assessor_check_english_language_proficiency_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("english_language_proficiency"), ) @@ -97,7 +97,7 @@ given_i_am_authorized_as_an_assessor_user when_i_visit_the( :assessor_check_english_language_proficiency_page, - application_form_id:, + reference:, assessment_id:, section_id: section_id("english_language_proficiency"), ) @@ -320,7 +320,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/creating_note_spec.rb b/spec/system/assessor_interface/creating_note_spec.rb index 133c5ff1a0..1d6c2cee48 100644 --- a/spec/system/assessor_interface/creating_note_spec.rb +++ b/spec/system/assessor_interface/creating_note_spec.rb @@ -8,30 +8,15 @@ given_i_am_authorized_as_an_assessor_user given_there_is_an_application_form - when_i_visit_the( - :assessor_application_page, - application_form_id: application_form.id, - ) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_add_note - then_i_see_the( - :assessor_create_note_page, - application_form_id: application_form.id, - ) + then_i_see_the(:assessor_create_note_page, reference:) when_i_create_a_note - then_i_see_the( - :assessor_application_page, - application_form_id: application_form.id, - ) + then_i_see_the(:assessor_application_page, reference:) - when_i_visit_the( - :assessor_timeline_page, - application_form_id: application_form.id, - ) - then_i_see_the( - :assessor_timeline_page, - application_form_id: application_form.id, - ) + when_i_visit_the(:assessor_timeline_page, reference:) + then_i_see_the(:assessor_timeline_page, reference:) and_i_see_the_note_timeline_event end @@ -62,4 +47,6 @@ def application_form @application_form ||= create(:application_form, :submitted, :with_assessment) end + + delegate :reference, to: :application_form end diff --git a/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb b/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb index b58447ab67..ad59a6c04e 100644 --- a/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb +++ b/spec/system/assessor_interface/duplicate_applicant_application_form_spec.rb @@ -8,7 +8,7 @@ given_there_is_an_application_form and_the_applicant_matches_a_record_in_dqt - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the_application and_i_see_the_warning_of_an_existing_record_in_dqt end @@ -61,7 +61,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def dqt_match { diff --git a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb index 87b300230c..b1ab12b122 100644 --- a/spec/system/assessor_interface/pre_assessment_tasks_spec.rb +++ b/spec/system/assessor_interface/pre_assessment_tasks_spec.rb @@ -10,50 +10,50 @@ end it "passes preliminary check" do - when_i_visit_the(:assessor_application_page, application_form_id:) - then_i_see_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_see_an_unstarted_preliminary_check_task when_i_click_on_the_preliminary_check_task and_i_choose_yes_to_both_questions - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_a_completed_preliminary_check_task and_the_teacher_receives_a_checks_passed_email and_the_assessor_is_unassigned end it "fails preliminary check" do - when_i_visit_the(:assessor_application_page, application_form_id:) - then_i_see_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_see_an_unstarted_preliminary_check_task when_i_click_on_the_preliminary_check_task and_i_choose_no_to_both_questions - then_i_see_the(:assessor_complete_assessment_page, application_form_id:) + then_i_see_the(:assessor_complete_assessment_page, reference:) when_i_select_decline_qts then_i_see_the( :assessor_declare_assessment_recommendation_page, - application_form_id:, + reference:, recommendation: "decline", ) and_i_see_the_failure_reasons end it "locate professional standing" do - when_i_visit_the(:assessor_application_page, application_form_id:) - then_i_see_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_awaiting_professional_standing then_i_see_the( :assessor_locate_professional_standing_request_page, - application_form_id:, + reference:, ) when_i_fill_in_the_locate_form - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) and_i_see_a_preliminary_check_status and_the_teacher_receives_a_professional_standing_received_email end @@ -197,5 +197,5 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form end diff --git a/spec/system/assessor_interface/requesting_further_information_spec.rb b/spec/system/assessor_interface/requesting_further_information_spec.rb index 92a8c1dcae..1b6a571e11 100644 --- a/spec/system/assessor_interface/requesting_further_information_spec.rb +++ b/spec/system/assessor_interface/requesting_further_information_spec.rb @@ -28,7 +28,7 @@ when_i_visit_the( :assessor_complete_assessment_page, - application_form_id:, + reference:, assessment_id:, ) @@ -36,7 +36,7 @@ and_i_click_continue then_i_see_the( :assessor_request_further_information_page, - application_form_id:, + reference:, assessment_id:, ) and_i_see_the_further_information_request_items @@ -44,7 +44,7 @@ when_i_click_continue_to_email_button then_i_see_the( :assessor_further_information_request_preview_page, - application_form_id:, + reference:, assessment_id:, ) and_i_see_the_email_preview @@ -52,7 +52,7 @@ when_i_click_send_to_applicant then_i_see_the( :assessor_further_information_request_page, - application_form_id:, + reference:, assessment_id:, further_information_request_id:, ) @@ -161,7 +161,7 @@ def application_form_for_work_history_contact end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/reverse_decision_spec.rb b/spec/system/assessor_interface/reverse_decision_spec.rb index 8d95badbc6..211c98ca0e 100644 --- a/spec/system/assessor_interface/reverse_decision_spec.rb +++ b/spec/system/assessor_interface/reverse_decision_spec.rb @@ -13,7 +13,7 @@ when_i_visit_the( :assessor_reverse_decision_page, - application_form_id:, + reference:, assessment_id:, ) then_i_see_the_forbidden_page @@ -22,19 +22,15 @@ it "allows reversing a decision" do given_i_am_authorized_as_a_user(manager) - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the(:assessor_application_page) and_i_see_the_reverse_decision_link when_i_click_on_reverse_decision - then_i_see_the( - :assessor_reverse_decision_page, - application_form_id:, - assessment_id:, - ) + then_i_see_the(:assessor_reverse_decision_page, reference:, assessment_id:) when_i_confirm_the_reversal - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) end def given_there_is_an_application_form @@ -59,7 +55,7 @@ def application_form create(:application_form, :declined, :with_personal_information) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment @assessment ||= create(:assessment, :decline, application_form:) diff --git a/spec/system/assessor_interface/reviewing_further_information_spec.rb b/spec/system/assessor_interface/reviewing_further_information_spec.rb index b62edfd7ac..8180544387 100644 --- a/spec/system/assessor_interface/reviewing_further_information_spec.rb +++ b/spec/system/assessor_interface/reviewing_further_information_spec.rb @@ -11,34 +11,34 @@ end it "review complete" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_review_requested_information then_i_see_the( :assessor_review_further_information_request_page, - application_form_id:, + reference:, assessment_id:, further_information_request_id:, ) and_i_see_the_check_your_answers_items when_i_mark_the_section_as_complete - then_i_see_the(:assessor_complete_assessment_page, application_form_id:) + then_i_see_the(:assessor_complete_assessment_page, reference:) and_i_see_an_award_qts_option end it "review incomplete" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_review_requested_information then_i_see_the( :assessor_review_further_information_request_page, - application_form_id:, + reference:, assessment_id:, further_information_request_id:, ) and_i_see_the_check_your_answers_items when_i_mark_the_section_as_incomplete - then_i_see_the(:assessor_complete_assessment_page, application_form_id:) + then_i_see_the(:assessor_complete_assessment_page, reference:) and_i_see_a_decline_qts_option end @@ -46,11 +46,11 @@ further_information_request.update!(review_passed: true) further_information_request.assessment.award! - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_review_requested_information then_i_see_the( :assessor_review_further_information_request_page, - application_form_id:, + reference:, assessment_id:, further_information_request_id:, ) @@ -144,7 +144,7 @@ def further_information_request ) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/reviewing_professional_standing_spec.rb b/spec/system/assessor_interface/reviewing_professional_standing_spec.rb index 7786ca28d7..88ef4f656b 100644 --- a/spec/system/assessor_interface/reviewing_professional_standing_spec.rb +++ b/spec/system/assessor_interface/reviewing_professional_standing_spec.rb @@ -10,28 +10,25 @@ end it "sends for review" do - when_i_visit_the(:assessor_application_page, application_form_id:) - then_i_see_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) + then_i_see_the(:assessor_application_page, reference:) when_i_click_on_verification_decision - then_i_see_the(:assessor_complete_assessment_page, application_form_id:) + then_i_see_the(:assessor_complete_assessment_page, reference:) when_i_select_send_for_review - then_i_see_the( - :assessor_assessment_recommendation_review_page, - application_form_id:, - ) + then_i_see_the(:assessor_assessment_recommendation_review_page, reference:) when_i_click_continue_from_review - then_i_see_the(:assessor_application_status_page, application_form_id:) + then_i_see_the(:assessor_application_status_page, reference:) when_i_click_on_overview_button - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) when_i_click_on_review_verifications then_i_see_the( :assessor_review_verifications_page, - application_form_id:, + reference:, assessment_id:, ) and_i_see_the_lops_not_started @@ -39,14 +36,14 @@ when_i_click_on_lops then_i_see_the( :assessor_review_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) when_i_submit_yes_on_the_review_form then_i_see_the( :assessor_review_verifications_page, - application_form_id:, + reference:, assessment_id:, ) and_i_see_the_lops_accepted @@ -54,25 +51,25 @@ when_i_click_on_lops then_i_see_the( :assessor_review_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) when_i_submit_no_on_the_review_form then_i_see_the( :assessor_review_verifications_page, - application_form_id:, + reference:, assessment_id:, ) and_i_see_the_lops_rejected when_i_click_on_back_to_overview - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) when_i_click_on_assessment_decision then_i_see_the( :assessor_complete_assessment_page, - application_form_id:, + reference:, assessment_id:, ) end @@ -171,7 +168,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/verifying_professional_standing_spec.rb b/spec/system/assessor_interface/verifying_professional_standing_spec.rb index 24d25ea5d2..2607fa5799 100644 --- a/spec/system/assessor_interface/verifying_professional_standing_spec.rb +++ b/spec/system/assessor_interface/verifying_professional_standing_spec.rb @@ -10,11 +10,11 @@ end it "verify" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_professional_standing_task then_i_see_the( :assessor_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_the_request_lops_verification_status_is("NOT STARTED") @@ -23,13 +23,13 @@ when_i_click_request_lops_verification then_i_see_the( :assessor_request_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_i_submit_unchecked_on_the_request_form then_i_see_the( :assessor_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_the_request_lops_verification_status_is("NOT STARTED") @@ -39,7 +39,7 @@ and_i_submit_checked_on_the_request_form then_i_see_the( :assessor_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_the_request_lops_verification_status_is("COMPLETED") @@ -48,13 +48,13 @@ when_i_click_record_lops_response then_i_see_the( :assessor_verify_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_i_submit_yes_on_the_verify_form then_i_see_the( :assessor_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_the_record_lops_response_status_is("COMPLETED") @@ -62,19 +62,19 @@ when_i_click_record_lops_response then_i_see_the( :assessor_verify_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_i_submit_no_on_the_verify_form then_i_see_the( :assessor_verify_failed_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_i_submit_an_internal_note then_i_see_the( :assessor_professional_standing_request_page, - application_form_id:, + reference:, assessment_id:, ) and_the_record_lops_response_status_is("REVIEW") @@ -151,7 +151,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/verifying_qualifications_spec.rb b/spec/system/assessor_interface/verifying_qualifications_spec.rb index 3102e4b0ff..e894c628b5 100644 --- a/spec/system/assessor_interface/verifying_qualifications_spec.rb +++ b/spec/system/assessor_interface/verifying_qualifications_spec.rb @@ -10,76 +10,64 @@ end it "received and passed" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_record_qualifications_task - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_select_the_first_qualification_request - then_i_see_the( - :assessor_edit_qualification_request_page, - application_form_id:, - ) + then_i_see_the(:assessor_edit_qualification_request_page, reference:) when_the_request_is_received_and_passed - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_go_back_to_overview and_i_see_an_in_progress_status end it "received and not passed" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_record_qualifications_task - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_select_the_first_qualification_request - then_i_see_the( - :assessor_edit_qualification_request_page, - application_form_id:, - ) + then_i_see_the(:assessor_edit_qualification_request_page, reference:) when_the_request_is_received_and_not_passed - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_go_back_to_overview and_i_see_an_in_progress_status end it "not received and failed" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_record_qualifications_task - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_select_the_first_qualification_request - then_i_see_the( - :assessor_edit_qualification_request_page, - application_form_id:, - ) + then_i_see_the(:assessor_edit_qualification_request_page, reference:) when_the_request_is_not_received_and_failed - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_go_back_to_overview and_i_see_an_in_progress_status end it "not received and not failed" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_record_qualifications_task - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_select_the_first_qualification_request - then_i_see_the( - :assessor_edit_qualification_request_page, - application_form_id:, - ) + then_i_see_the(:assessor_edit_qualification_request_page, reference:) when_the_request_is_not_received_and_not_failed - then_i_see_the(:assessor_qualification_requests_page, application_form_id:) + then_i_see_the(:assessor_qualification_requests_page, reference:) when_i_go_back_to_overview and_i_see_a_waiting_on_status @@ -174,5 +162,5 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form end diff --git a/spec/system/assessor_interface/verifying_references_spec.rb b/spec/system/assessor_interface/verifying_references_spec.rb index dcd3581696..aa4efb55aa 100644 --- a/spec/system/assessor_interface/verifying_references_spec.rb +++ b/spec/system/assessor_interface/verifying_references_spec.rb @@ -10,15 +10,15 @@ end it "Verify accepted references" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_see_a_waiting_on_status and_i_click_verify_references - then_i_see_the(:assessor_reference_requests_page, application_form_id:) + then_i_see_the(:assessor_reference_requests_page, reference:) when_i_click_on_a_reference_request then_i_see_the( :assessor_edit_reference_request_page, - application_form_id:, + reference:, assessment_id:, id: reference_request.id, ) @@ -167,7 +167,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment_id application_form.assessment.id diff --git a/spec/system/assessor_interface/view_application_form_spec.rb b/spec/system/assessor_interface/view_application_form_spec.rb index 7f732b625b..68018628a7 100644 --- a/spec/system/assessor_interface/view_application_form_spec.rb +++ b/spec/system/assessor_interface/view_application_form_spec.rb @@ -6,7 +6,7 @@ given_there_is_an_application_form given_i_am_authorized_as_an_assessor_user - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the_application and_i_see_the_assessment_tasks @@ -74,5 +74,5 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form end diff --git a/spec/system/assessor_interface/view_timeline_events_spec.rb b/spec/system/assessor_interface/view_timeline_events_spec.rb index c50496cf05..5c56f3cd94 100644 --- a/spec/system/assessor_interface/view_timeline_events_spec.rb +++ b/spec/system/assessor_interface/view_timeline_events_spec.rb @@ -9,7 +9,7 @@ end it "displays the timeline events" do - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) and_i_click_view_timeline then_i_see_the_timeline end @@ -60,7 +60,7 @@ def application_form end end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessor @assessor ||= create(:staff, :confirmed) diff --git a/spec/system/assessor_interface/withdraw_application_spec.rb b/spec/system/assessor_interface/withdraw_application_spec.rb index 26e16c21cc..22035241f7 100644 --- a/spec/system/assessor_interface/withdraw_application_spec.rb +++ b/spec/system/assessor_interface/withdraw_application_spec.rb @@ -13,7 +13,7 @@ when_i_visit_the( :assessor_reverse_decision_page, - application_form_id:, + reference:, assessment_id:, ) then_i_see_the_forbidden_page @@ -22,15 +22,15 @@ it "allows withdrawing an application" do given_i_am_authorized_as_a_user(manager) - when_i_visit_the(:assessor_application_page, application_form_id:) + when_i_visit_the(:assessor_application_page, reference:) then_i_see_the(:assessor_application_page) and_i_see_the_withdraw_link when_i_click_on_withdraw - then_i_see_the(:assessor_withdraw_application_page, application_form_id:) + then_i_see_the(:assessor_withdraw_application_page, reference:) when_i_confirm_the_withdrawal - then_i_see_the(:assessor_application_page, application_form_id:) + then_i_see_the(:assessor_application_page, reference:) end def given_there_is_an_application_form @@ -55,7 +55,7 @@ def application_form create(:application_form, :declined, :with_personal_information) end - delegate :id, to: :application_form, prefix: true + delegate :reference, to: :application_form def assessment @assessment ||= create(:assessment, :decline, application_form:) diff --git a/spec/system/teacher_interface/check_answers_spec.rb b/spec/system/teacher_interface/check_answers_spec.rb index 1326557925..3635c0a7c3 100644 --- a/spec/system/teacher_interface/check_answers_spec.rb +++ b/spec/system/teacher_interface/check_answers_spec.rb @@ -6,7 +6,7 @@ given_i_am_authorized_as_a_user(teacher) given_there_is_an_application_form - when_i_visit_the(:teacher_check_your_answers_page, application_form_id:) + when_i_visit_the(:teacher_check_your_answers_page) end it "about you section" do @@ -68,22 +68,22 @@ end it "display application form work history before qualifications banner" do - when_i_visit_the(:teacher_check_your_answers_page, application_form_id:) do + when_i_visit_the(:teacher_check_your_answers_page) do and_i_have_early_work_history then_i_see_the_banner end - when_i_visit_the(:teacher_check_your_answers_page, application_form_id:) do + when_i_visit_the(:teacher_check_your_answers_page) do and_i_have_later_work_history then_i_do_not_see_the_banner end - when_i_visit_the(:teacher_check_your_answers_page, application_form_id:) do + when_i_visit_the(:teacher_check_your_answers_page) do and_i_have_no_work_history then_i_do_not_see_the_banner end - when_i_visit_the(:teacher_check_your_answers_page, application_form_id:) do + when_i_visit_the(:teacher_check_your_answers_page) do and_i_have_no_qualifications then_i_do_not_see_the_banner end @@ -172,6 +172,4 @@ def application_form teacher:, ) end - - delegate :id, to: :application_form, prefix: true end diff --git a/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb b/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb index 7aad7e9514..fa832ddce8 100644 --- a/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb @@ -21,7 +21,9 @@ end context "with a draft application form" do - let(:params) { { id: create(:application_form, :draft).id } } + let(:params) do + { reference: create(:application_form, :draft).reference } + end it "raise an error" do expect { application_form }.to raise_error(ActiveRecord::RecordNotFound) @@ -29,7 +31,9 @@ end context "with a submitted application form" do - let(:params) { { id: create(:application_form, :submitted).id } } + let(:params) do + { reference: create(:application_form, :submitted).reference } + end it { is_expected.to_not be_nil } end @@ -44,7 +48,7 @@ create(:assessment_section, :personal_information, assessment:) end - let(:params) { { id: application_form.id } } + let(:params) { { reference: application_form.reference } } it do is_expected.to_not include_task_list_item( @@ -457,7 +461,7 @@ ) end - let(:params) { { id: application_form.id } } + let(:params) { { reference: application_form.reference } } context "the email address is used as a reference" do before do @@ -497,7 +501,7 @@ ) end - let(:params) { { id: application_form.id } } + let(:params) { { reference: application_form.reference } } context "the email address is used as a reference" do before do @@ -535,7 +539,7 @@ ) end - let(:params) { { id: application_form.id } } + let(:params) { { reference: application_form.reference } } context "the email address is used as a reference in the same application" do before do @@ -581,7 +585,7 @@ create(:application_form, :submitted, :with_assessment) end - let(:params) { { id: application_form.id } } + let(:params) { { reference: application_form.reference } } it { is_expected.to be_empty } diff --git a/spec/view_objects/assessor_interface/assessment_section_view_object_spec.rb b/spec/view_objects/assessor_interface/assessment_section_view_object_spec.rb index 365ce0b404..c4a3fb1b67 100644 --- a/spec/view_objects/assessor_interface/assessment_section_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/assessment_section_view_object_spec.rb @@ -15,7 +15,7 @@ { id: assessment_section.id, assessment_id: assessment.id, - application_form_id: application_form.id, + application_form_reference: application_form.reference, } end diff --git a/spec/view_objects/assessor_interface/further_information_request_view_object_spec.rb b/spec/view_objects/assessor_interface/further_information_request_view_object_spec.rb index f3609e47ac..0a35f0cdc9 100644 --- a/spec/view_objects/assessor_interface/further_information_request_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/further_information_request_view_object_spec.rb @@ -16,7 +16,7 @@ { id: further_information_request.id, assessment_id: assessment.id, - application_form_id: application_form.id, + application_form_reference: application_form.reference, } end