From f3179a2f4866eee5a4781b771c571306adbc22f8 Mon Sep 17 00:00:00 2001 From: Iain McNulty Date: Thu, 9 Jan 2025 15:18:14 +0000 Subject: [PATCH] Update Ratifying partner text --- .../courses/accredited_provider_controller.rb | 4 +- .../courses/_basic_details_tab.html.erb | 10 +-- .../_provider_suggestion.html.erb | 2 +- .../courses/accredited_provider/edit.html.erb | 10 +-- .../courses/accredited_provider/new.html.erb | 8 +- .../accredited_provider/search.html.erb | 4 +- .../accredited_provider/search_new.html.erb | 4 +- .../publish/courses/confirmation.html.erb | 6 +- app/views/publish/courses/index.html.erb | 2 +- app/views/support/courses/index.html.erb | 2 +- config/locales/en.yml | 8 +- .../missing_information_component_spec.rb | 2 +- ..._partner_when_publishing_a_course_spec.rb} | 36 ++++---- ..._provider_to_an_unpublished_course_spec.rb | 48 +++++----- .../courses/new_accredited_provider_spec.rb | 16 ++-- .../publish/courses/new_schools_spec.rb | 6 +- ...ider_spec.rb => ratifying_partner_spec.rb} | 90 +++++++++---------- .../providers/accredited_providers_spec.rb | 20 ++--- spec/models/course/publishable_spec.rb | 4 +- spec/support/page_objects/find/course_show.rb | 2 +- .../publish/course_confirmation.rb | 2 +- .../page_objects/publish/course_preview.rb | 2 +- .../publish/courses/accredited_providers.rb | 2 +- ...d_provider.rb => new_ratifying_partner.rb} | 4 +- .../publish/provider_courses_details.rb | 2 +- 25 files changed, 148 insertions(+), 148 deletions(-) rename spec/features/publish/courses/{add_accredited_provider_when_publishing_a_course_spec.rb => add_ratifying_partner_when_publishing_a_course_spec.rb} (80%) rename spec/features/publish/{accredited_provider_spec.rb => ratifying_partner_spec.rb} (73%) rename spec/support/page_objects/publish/courses/{new_accredited_provider.rb => new_ratifying_partner.rb} (84%) diff --git a/app/controllers/publish/courses/accredited_provider_controller.rb b/app/controllers/publish/courses/accredited_provider_controller.rb index 49fcb7ec7f..59993ca901 100644 --- a/app/controllers/publish/courses/accredited_provider_controller.rb +++ b/app/controllers/publish/courses/accredited_provider_controller.rb @@ -65,7 +65,7 @@ def update if update_params[:accredited_provider_code] == 'other' redirect_to_provider_search elsif @course.update(update_params) - course_updated_message('Accredited provider') + course_updated_message('Ratifying partner') redirect_to_update_successful else @errors = @course.errors.messages @@ -127,7 +127,7 @@ def errors_for_search_query(code, query) if other_selected_with_no_autocompleted_code?(code) && query.length < 2 errors = { accredited_provider: ['Accredited provider search too short, enter 2 or more characters'] } elsif code.blank? - errors = { accredited_provider_code: ['Select an accredited provider'] } + errors = { accredited_provider_code: ['Select a ratifying partner'] } end errors diff --git a/app/views/publish/courses/_basic_details_tab.html.erb b/app/views/publish/courses/_basic_details_tab.html.erb index 18900b33b3..68fdd33804 100644 --- a/app/views/publish/courses/_basic_details_tab.html.erb +++ b/app/views/publish/courses/_basic_details_tab.html.erb @@ -153,21 +153,21 @@ end unless @provider.accredited_provider? - summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row| - row.with_key { "Accredited provider" } + summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row| + row.with_key { "Ratifying partner" } row.with_value { course.accrediting_provider&.provider_name } if course.is_published? || course.is_withdrawn? row.with_action elsif !course.accrediting_provider.nil? row.with_action(href: accredited_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code), - visually_hidden_text: "accredited provider") + visually_hidden_text: "ratifying partner") elsif @provider.accredited_providers.any? row.with_value do - "
#{govuk_link_to('Select an accredited provider', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}
".html_safe + "
#{govuk_link_to('Select an accredited partner', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}
".html_safe end else row.with_value do - "
#{govuk_link_to('Add at least one accredited provider', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}
".html_safe + "
#{govuk_link_to('Add at least one accredited partner', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}
".html_safe end end end diff --git a/app/views/publish/courses/accredited_provider/_provider_suggestion.html.erb b/app/views/publish/courses/accredited_provider/_provider_suggestion.html.erb index c8d347af03..96e9ffa36e 100644 --- a/app/views/publish/courses/accredited_provider/_provider_suggestion.html.erb +++ b/app/views/publish/courses/accredited_provider/_provider_suggestion.html.erb @@ -1,4 +1,4 @@ -
+
<%= form.radio_button :accredited_provider_code, provider_suggestion[:provider_code], checked: provider_suggestion[:provider_code] == @course.accrediting_provider&.provider_code, diff --git a/app/views/publish/courses/accredited_provider/edit.html.erb b/app/views/publish/courses/accredited_provider/edit.html.erb index f431942f30..21fc927329 100644 --- a/app/views/publish/courses/accredited_provider/edit.html.erb +++ b/app/views/publish/courses/accredited_provider/edit.html.erb @@ -1,4 +1,4 @@ -<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", course.errors.any?) %> +<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", course.errors.any?) %> <% content_for :before_content do %> <%= govuk_back_link_to(details_publish_provider_recruitment_cycle_course_path(course.provider_code, course.recruitment_cycle_year, course.course_code)) %> @@ -10,7 +10,7 @@

<%= render CaptionText.new(text: course.name_and_code) %> - Accredited provider + Ratifying partner

@@ -20,14 +20,14 @@ url: accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code), method: :put do |form| %> -
+
<%= render partial: "provider_suggestion", collection: @provider.accredited_bodies, locals: { form: } %>
- <%= form.submit "Update accredited provider", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %> + <%= form.submit "Update ratifying partner", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %> <%= govuk_link_to( - "Add accredited provider", + "Add accredited partner", search_publish_provider_recruitment_cycle_accredited_providers_path(course.provider_code, course.recruitment_cycle_year), class: "govuk-!-margin-bottom-6 govuk-!-margin-top-5", data: { qa: "course__add" } diff --git a/app/views/publish/courses/accredited_provider/new.html.erb b/app/views/publish/courses/accredited_provider/new.html.erb index 163b73fca3..7296f37b18 100644 --- a/app/views/publish/courses/accredited_provider/new.html.erb +++ b/app/views/publish/courses/accredited_provider/new.html.erb @@ -1,4 +1,4 @@ -<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", @errors && @errors.any?) %> +<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", @errors && @errors.any?) %> <% content_for :before_content do %> <%= govuk_back_link_to(@back_link_path) %> @@ -9,17 +9,17 @@
<%= form_with url: continue_publish_provider_recruitment_cycle_courses_accredited_provider_path(@provider.provider_code, @provider.recruitment_cycle_year), method: :get do |form| %> <%= render "publish/courses/new_fields_holder", form:, except_keys: [:accredited_provider_code] do |fields| %> - <%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__accredited_provider" do %> + <%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__ratifying_partner" do %>

<%= render CaptionText.new(text: t("course.add_course")) %> - Accredited provider + Ratifying partner

<%= render "publish/shared/error_messages", error_keys: [:accredited_provider_code] %> -
+
<% if @provider.accredited_bodies.length > 0 %> <%= render partial: "provider_suggestion", collection: @provider.accredited_bodies.sort_by { |k| k[:provider_name] }, locals: { form: fields } %> <% else %> diff --git a/app/views/publish/courses/accredited_provider/search.html.erb b/app/views/publish/courses/accredited_provider/search.html.erb index 4e3c6e27b9..b1563304bd 100644 --- a/app/views/publish/courses/accredited_provider/search.html.erb +++ b/app/views/publish/courses/accredited_provider/search.html.erb @@ -9,7 +9,7 @@

- Pick an accredited provider + Pick an accredited partner

You searched for ‘<%= @query %>’.

@@ -21,7 +21,7 @@ <% if @provider_suggestions.any? %>

We found these providers which matched your search:

-
+
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
or
diff --git a/app/views/publish/courses/accredited_provider/search_new.html.erb b/app/views/publish/courses/accredited_provider/search_new.html.erb index 1d11bc2dc2..e5537b52cc 100644 --- a/app/views/publish/courses/accredited_provider/search_new.html.erb +++ b/app/views/publish/courses/accredited_provider/search_new.html.erb @@ -5,7 +5,7 @@

- Pick an accredited provider + Pick an accredited partner

You searched for ‘<%= @query %>’.

@@ -25,7 +25,7 @@ <% if @provider_suggestions.any? %>

We found these providers which matched your search:

-
+
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
or
diff --git a/app/views/publish/courses/confirmation.html.erb b/app/views/publish/courses/confirmation.html.erb index 54c8f5ee99..1ed80db0b1 100644 --- a/app/views/publish/courses/confirmation.html.erb +++ b/app/views/publish/courses/confirmation.html.erb @@ -152,13 +152,13 @@ <% end %> <% unless @provider.accredited_provider? || course.is_further_education? %> - <% summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row| %> - <% row.with_key { "Accredited provider" } %> + <% summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row| %> + <% row.with_key { "Ratifying partner" } %> <% row.with_value { course.accrediting_provider.provider_name } %> <% if @provider.accredited_bodies.length > 1 %> <% row.with_action( href: new_publish_provider_recruitment_cycle_courses_accredited_provider_path(course.provider.provider_code, course.recruitment_cycle.year, params.to_unsafe_h.merge(goto_confirmation: true)), - visually_hidden_text: "accredited provider" + visually_hidden_text: "ratifying partner" ) %> <% else %> <% row.with_action %> diff --git a/app/views/publish/courses/index.html.erb b/app/views/publish/courses/index.html.erb index 978e2db780..237834c627 100644 --- a/app/views/publish/courses/index.html.erb +++ b/app/views/publish/courses/index.html.erb @@ -14,7 +14,7 @@ <% @courses_by_accrediting_provider.each do |accrediting_provider, courses| %>

- Accredited provider + Ratifying partner <%= accrediting_provider %>

diff --git a/app/views/support/courses/index.html.erb b/app/views/support/courses/index.html.erb index 2a82025357..7723a72232 100644 --- a/app/views/support/courses/index.html.erb +++ b/app/views/support/courses/index.html.erb @@ -8,7 +8,7 @@ Course name and code Status - Ratifying Provider + Ratifying partner diff --git a/config/locales/en.yml b/config/locales/en.yml index 6422711322..5275f7bf04 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -334,7 +334,7 @@ en: train_with_us: text: "Enter details about the training provider" about_accrediting_provider: - text: "Enter details about the accredited provider" + text: "Enter details about the ratifying partner" value_not_entered: "Not entered" a_level_grades: minimum_grade: Grade %{minimum_grade} @@ -828,9 +828,9 @@ en: applications_open_from: blank: "Select an applications open date" accrediting_provider: - blank: "Select an accredited provider" - is_not_accredited: "Update the accredited provider" - does_not_exist_in_cycle: "The accredited provider %{accredited_provider_code} does not exist in this cycle" + blank: "Select a ratifying partner" + is_not_accredited: "Update the ratifying partner" + does_not_exist_in_cycle: "The accredited partner %{accredited_provider_code} does not exist in this cycle" is_send: inclusion: Select if this course has a special educational needs and disability (SEND) specialism a_level_subject_requirements: diff --git a/spec/components/course_preview/missing_information_component_spec.rb b/spec/components/course_preview/missing_information_component_spec.rb index f039463d61..e48babec09 100644 --- a/spec/components/course_preview/missing_information_component_spec.rb +++ b/spec/components/course_preview/missing_information_component_spec.rb @@ -52,7 +52,7 @@ module CoursePreview include_examples 'course with missing information', :train_with_disability, 'Enter details about training with disabilities and other needs' include_examples 'course with missing information', :train_with_us, 'Enter details about the training provider' - include_examples 'course with missing information', :about_accrediting_provider, 'Enter details about the accredited provider' + include_examples 'course with missing information', :about_accrediting_provider, 'Enter details about the ratifying partner' end end end diff --git a/spec/features/publish/courses/add_accredited_provider_when_publishing_a_course_spec.rb b/spec/features/publish/courses/add_ratifying_partner_when_publishing_a_course_spec.rb similarity index 80% rename from spec/features/publish/courses/add_accredited_provider_when_publishing_a_course_spec.rb rename to spec/features/publish/courses/add_ratifying_partner_when_publishing_a_course_spec.rb index 0e56ce6491..36ebdf1764 100644 --- a/spec/features/publish/courses/add_accredited_provider_when_publishing_a_course_spec.rb +++ b/spec/features/publish/courses/add_ratifying_partner_when_publishing_a_course_spec.rb @@ -7,14 +7,14 @@ given_i_am_authenticated_as_a_provider_user end - scenario 'Add accrediting provider to provider and provider has no accrediting providers, change accrediting provider of course then publish' do - and_the_provider_has_no_accredited_provider + scenario 'Add ratifying provider to training provider and provider has no accredited partner, change ratifying provider of course then publish' do + and_the_provider_has_no_accredited_partners and_there_is_a_draft_course_with_an_unaccredited_provider # Publising is invalid when_i_visit_the_course_page and_i_click_the_publish_button - then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited + then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited # Add accrediting provider to provider when_i_click_the_error_message_link @@ -28,11 +28,11 @@ # Publishing is invalid when_i_visit_the_course_page and_i_click_the_publish_button - then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited + then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited # Clicking error message allows user to select accrediting provider when_i_click_the_error_message_link - and_i_choose_the_new_accredited_provider + and_i_choose_the_new_accredited_partner and_i_click_the_publish_button then_i_should_see_a_success_message end @@ -49,7 +49,7 @@ # Clicking error message allows user to select accrediting provider when_i_click_the_select_accredited_provider_error_message_link - and_i_choose_the_new_accredited_provider + and_i_choose_the_new_accredited_partner and_i_click_the_publish_button then_i_should_see_a_success_message end @@ -68,7 +68,7 @@ def and_the_provider_has_a_valid_accrediting_provider provider.update!(accrediting_provider_enrichments: [enrichment]) end - def and_the_provider_has_no_accredited_provider + def and_the_provider_has_no_accredited_partners expect(provider.accredited_providers).to be_empty end @@ -103,12 +103,12 @@ def then_i_should_see_a_success_message expect(page).to have_content('Your course has been published.') end - def then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited - expect(publish_provider_courses_show_page.error_messages).to include('Update the accredited provider') + def then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited + expect(publish_provider_courses_show_page.error_messages).to include('Update the ratifying partner') end def then_i_should_see_an_error_message_for_the_accrediting_provider - expect(publish_provider_courses_show_page.error_messages).to include('Select an accredited provider') + expect(publish_provider_courses_show_page.error_messages).to include('Select a ratifying partner') end def when_i_click_the_error_message_link @@ -132,17 +132,17 @@ def and_i_search_for_an_accredited_provider end def and_i_fill_in_the_accredited_provider_form - publish_courses_new_accredited_provider_page.about_section_input.set('About course') + publish_courses_new_ratifying_partner_page.about_section_input.set('About course') - publish_courses_new_accredited_provider_page.submit.click + publish_courses_new_ratifying_partner_page.submit.click end def and_i_confirm_creation_of_the_accredited_provider - publish_courses_new_accredited_provider_page.submit.click + publish_courses_new_ratifying_partner_page.submit.click end def then_i_see_that_the_accredited_provider_has_been_added - expect(page).to have_content('Accredited provider added') + expect(page).to have_content('Accredited partner added') end def and_i_click_the_publish_button @@ -150,13 +150,13 @@ def and_i_click_the_publish_button end def when_i_click_the_select_accredited_provider_error_message_link - page.click_link_or_button('Select an accredited provider') + page.click_link_or_button('Select a ratifying partner') end - def and_i_choose_the_new_accredited_provider + def and_i_choose_the_new_accredited_partner choose accredited_provider.provider_name - page.click_link_or_button('Update accredited provider') - expect(page).to have_content('Accredited provider updated') + page.click_link_or_button('Update ratifying partner') + expect(page).to have_content('Ratifying partner updated') end def and_an_accredited_provider_exists diff --git a/spec/features/publish/courses/adding_an_accredited_provider_to_an_unpublished_course_spec.rb b/spec/features/publish/courses/adding_an_accredited_provider_to_an_unpublished_course_spec.rb index a1764de28e..83213cd19e 100644 --- a/spec/features/publish/courses/adding_an_accredited_provider_to_an_unpublished_course_spec.rb +++ b/spec/features/publish/courses/adding_an_accredited_provider_to_an_unpublished_course_spec.rb @@ -2,44 +2,44 @@ require 'rails_helper' -feature 'unpublished course without accredited provider', { can_edit_current_and_next_cycles: false } do - scenario 'adding and changing an accredited provider' do +feature 'unpublished course without ratifying provider', { can_edit_current_and_next_cycles: false } do + scenario 'adding and changing an ratifying provider' do given_i_am_authenticated_as_a_provider_user - and_i_visit_the_course_details_page_of_a_course_without_an_accredited_provider + and_i_visit_the_course_details_page_of_a_course_without_an_ratifying_provider and_i_click_the_add_accredited_provider_link - and_i_create_a_new_accredited_provider + and_i_create_a_new_accredited_partnership and_i_revisit_the_course_details_page - when_i_click_select_an_accredited_provider - and_i_choose_the_new_accredited_provider + when_i_click_select_an_accredited_partner + and_i_choose_the_new_ratifying_provider then_i_should_see_the_success_message - given_i_click_change_accredited_provider - and_i_click_update_accredited_provider + given_i_click_change_ratifying_partner + and_i_click_update_ratifying_provider then_i_should_see_the_success_message end - def given_i_click_change_accredited_provider - click_link_or_button 'Change accredited provider' + def given_i_click_change_ratifying_partner + click_link_or_button 'Change ratifying partner' end def then_i_should_see_the_success_message - expect(page).to have_text('Accredited provider updated') + expect(page).to have_text('Ratifying partner updated') end - def and_i_click_update_accredited_provider - click_link_or_button 'Update accredited provider' + def and_i_click_update_ratifying_provider + click_link_or_button 'Update ratifying partner' end - def and_i_choose_the_new_accredited_provider + def and_i_choose_the_new_ratifying_provider choose @accredited_provider.provider_name - and_i_click_update_accredited_provider + and_i_click_update_ratifying_provider end - def when_i_click_select_an_accredited_provider - click_link_or_button 'Select an accredited provider' + def when_i_click_select_an_accredited_partner + click_link_or_button 'Select an accredited partner' end - def and_i_create_a_new_accredited_provider + def and_i_create_a_new_accredited_partnership and_there_is_an_accredited_provider_in_the_database and_i_click_add_accredited_provider_link and_i_search_for_an_accredited_provider_with_a_valid_query @@ -54,7 +54,7 @@ def and_i_select_the_provider end def and_i_input_some_information - fill_in 'About the accredited provider', with: 'This is a description' + fill_in 'About the accredited partner', with: 'This is a description' click_continue end @@ -76,15 +76,15 @@ def form_title end def and_i_click_the_add_accredited_provider_link - click_link_or_button 'Add at least one accredited provider' + click_link_or_button 'Add at least one accredited partner' end def and_i_click_add_accredited_provider_link - click_link_or_button 'Add accredited provider' + click_link_or_button 'Add accredited partner' end def and_i_click_add_accredited_provider_button - click_link_or_button 'Add accredited provider' + click_link_or_button 'Add accredited partner' end def given_i_am_authenticated_as_a_provider_user @@ -98,13 +98,13 @@ def given_i_am_authenticated_as_a_provider_user ) end - def and_i_visit_the_course_details_page_of_a_course_without_an_accredited_provider + def and_i_visit_the_course_details_page_of_a_course_without_an_ratifying_provider publish_provider_courses_details_page.load( provider_code: provider.provider_code, recruitment_cycle_year: provider.recruitment_cycle_year, course_code: course.course_code ) end - alias_method :and_i_revisit_the_course_details_page, :and_i_visit_the_course_details_page_of_a_course_without_an_accredited_provider + alias_method :and_i_revisit_the_course_details_page, :and_i_visit_the_course_details_page_of_a_course_without_an_ratifying_provider def provider @current_user.providers.first diff --git a/spec/features/publish/courses/new_accredited_provider_spec.rb b/spec/features/publish/courses/new_accredited_provider_spec.rb index 2c952020a2..5ad19b2ae9 100644 --- a/spec/features/publish/courses/new_accredited_provider_spec.rb +++ b/spec/features/publish/courses/new_accredited_provider_spec.rb @@ -5,11 +5,11 @@ feature 'selection accredited_bodies', { can_edit_current_and_next_cycles: false } do before do given_i_am_authenticated_as_a_provider_user - when_i_visit_the_new_accredited_providers_page + when_i_visit_the_new_ratifying_partner_page end scenario 'selecting multiple accredited_bodies' do - when_i_select_an_accredited_provider + when_i_select_a_ratifying_partner and_i_click_continue then_i_am_met_with_the_applications_open_page end @@ -33,16 +33,16 @@ def given_i_am_authenticated_as_a_provider_user given_i_am_authenticated(user: @user) end - def when_i_visit_the_new_accredited_providers_page - publish_courses_new_accredited_provider_page.load(provider_code: provider.provider_code, recruitment_cycle_year: Settings.current_recruitment_cycle_year, query: accredited_provider_params) + def when_i_visit_the_new_ratifying_partner_page + publish_courses_new_ratifying_partner_page.load(provider_code: provider.provider_code, recruitment_cycle_year: Settings.current_recruitment_cycle_year, query: accredited_provider_params) end - def when_i_select_an_accredited_provider - publish_courses_new_accredited_provider_page.find("#course_accredited_provider_code_#{@accredited_provider_code.downcase}").click + def when_i_select_a_ratifying_partner + publish_courses_new_ratifying_partner_page.find("#course_accredited_provider_code_#{@accredited_provider_code.downcase}").click end def and_i_click_continue - publish_courses_new_accredited_provider_page.continue.click + publish_courses_new_ratifying_partner_page.continue.click end def provider @@ -56,6 +56,6 @@ def then_i_am_met_with_the_applications_open_page def then_i_am_met_with_errors expect(page).to have_content('There is a problem') - expect(page).to have_content('Select an accredited provider') + expect(page).to have_content('Select a ratifying partner') end end diff --git a/spec/features/publish/courses/new_schools_spec.rb b/spec/features/publish/courses/new_schools_spec.rb index 1f33ef0bac..4b95b3ba47 100644 --- a/spec/features/publish/courses/new_schools_spec.rb +++ b/spec/features/publish/courses/new_schools_spec.rb @@ -12,7 +12,7 @@ scenario 'selecting multiple schools' do when_i_select_a_school and_i_click_continue - then_i_am_met_with_the_accredited_provider_page + then_i_am_met_with_the_ratifying_partner_page end scenario 'invalid entries' do @@ -48,9 +48,9 @@ def provider @provider ||= @user.providers.first end - def then_i_am_met_with_the_accredited_provider_page + def then_i_am_met_with_the_ratifying_partner_page expect(page).to have_current_path("/publish/organisations/#{provider.provider_code}/#{Settings.current_recruitment_cycle_year}/courses/accredited-provider/new", ignore_query: true) - expect(page).to have_content('Accredited provider') + expect(page).to have_content('Ratifying partner') end def then_i_am_met_with_errors diff --git a/spec/features/publish/accredited_provider_spec.rb b/spec/features/publish/ratifying_partner_spec.rb similarity index 73% rename from spec/features/publish/accredited_provider_spec.rb rename to spec/features/publish/ratifying_partner_spec.rb index 4dc5b09d2e..ea150459ec 100644 --- a/spec/features/publish/accredited_provider_spec.rb +++ b/spec/features/publish/ratifying_partner_spec.rb @@ -2,26 +2,26 @@ require 'rails_helper' -feature 'Accredited provider flow', { can_edit_current_and_next_cycles: false } do +feature 'Ratifying partner flow', { can_edit_current_and_next_cycles: false } do before do given_i_am_a_lead_school_provider_user and_i_visit_the_root_path - when_i_click_on_the_accredited_provider_tab + when_i_click_on_the_accredited_partners_tab end - scenario 'i can view the accredited providers tab when there are none' do - then_i_see_the_correct_text_for_no_accredited_providers + scenario 'i can view the accredited partnerships tab when there are none' do + then_i_see_the_correct_text_for_no_accredited_partners end - scenario 'i can view accredited providers on the index page' do - and_my_provider_has_accrediting_providers - and_i_click_on_the_accredited_provider_tab - then_i_should_see_the_accredited_provider_name_displayed + scenario 'i can view accredited partners on the index page' do + and_my_provider_has_accrediting_partners + and_i_click_on_the_accredited_partners_tab + then_i_should_see_the_accredited_partners_name_displayed end - scenario 'i can edit accredited providers on the index page' do - and_my_provider_has_accrediting_providers - and_i_click_on_the_accredited_provider_tab + scenario 'i can edit accredited partners on the index page' do + and_my_provider_has_accrediting_partners + and_i_click_on_the_accredited_partners_tab and_i_click_change when_i_input_some_different_information @@ -29,24 +29,24 @@ and_i_see_the_success_message end - scenario 'i cannot delete accredited providers if they are attached to a course' do - and_my_provider_has_accrediting_providers - and_i_click_on_the_accredited_provider_tab + scenario 'i cannot delete accredited partners if they are attached to a course' do + and_my_provider_has_accrediting_partners + and_i_click_on_the_accredited_partners_tab and_i_click_remove then_i_should_see_the_cannot_remove_ap_text end - scenario 'i can delete accredited providers if they are not attached to a course' do - and_i_create_a_new_accredited_provider + scenario 'i can delete accredited partners if they are not attached to a course' do + and_i_create_a_new_accredited_partner and_i_click_remove and_i_click_remove_ap and_i_see_the_remove_success_message then_i_should_be_taken_to_the_index_page end - scenario 'i can search for an accredited provider when they are searchable' do + scenario 'i can search for an accredited partners when they are searchable' do given_there_are_accredited_providers_in_the_database_with_users - when_i_click_add_accredited_provider + when_i_click_add_accredited_partner and_i_search_with_an_invalid_query then_i_should_see_an_error_message @@ -59,7 +59,7 @@ when_i_select_the_provider and_i_continue_without_entering_a_description - then_i_should_see_an_error_message('Enter details about the accredited provider') + then_i_should_see_an_error_message('Enter details about the accredited partner') when_i_input_some_information then_i_should_see_the_information_i_added @@ -68,18 +68,18 @@ then_i_should_be_taken_to_the_index_page and_the_accredited_provider_is_saved_to_the_database and_i_should_see_a_success_message - and_i_should_see_the_accredited_providers + and_i_should_see_the_accredited_partners end scenario 'back links behaviour' do given_i_am_on_the_confirm_page - when_i_click_the_change_link_for('accredited provider name') + when_i_click_the_change_link_for('accredited partner name') then_i_should_be_taken_to_the_accredited_provider_search_page when_i_click_the_back_link then_i_should_be_taken_back_to_the_confirm_page - when_i_click_the_change_link_for('accredited provider description') + when_i_click_the_change_link_for('accredited partner description') then_i_should_be_taken_to_the_accredited_provider_description_page when_i_click_the_back_link @@ -89,20 +89,20 @@ private def and_i_click_remove_ap - click_link_or_button 'Remove accredited provider' + click_link_or_button 'Remove accredited partner' end def then_i_should_see_the_cannot_remove_ap_text - expect(page).to have_css('h1', text: 'You cannot remove this accredited provider') + expect(page).to have_css('h1', text: 'You cannot remove this accredited partner') end def and_i_click_remove click_link_or_button 'Remove' end - def and_i_create_a_new_accredited_provider + def and_i_create_a_new_accredited_partner given_there_are_accredited_providers_in_the_database_with_users - when_i_click_add_accredited_provider + when_i_click_add_accredited_partner when_i_search_for_an_accredited_provider_with_a_valid_query when_i_select_the_provider when_i_input_some_information @@ -113,7 +113,7 @@ def and_i_click_change click_link_or_button('Change') end - def and_i_should_see_the_accredited_providers + def and_i_should_see_the_accredited_partners expect(page).to have_css('.govuk-summary-card', count: 1) expect(page).to have_content(@accredited_provider.provider_name) end @@ -150,22 +150,22 @@ def when_i_click_the_change_link_for(field) def given_i_am_on_the_confirm_page given_there_are_accredited_providers_in_the_database_with_users - when_i_click_add_accredited_provider + when_i_click_add_accredited_partner when_i_search_for_an_accredited_provider_with_a_valid_query when_i_select_the_provider when_i_input_some_information end def and_i_should_see_a_success_message - expect(page).to have_content('Accredited provider added') + expect(page).to have_content('Accredited partner added') end def and_i_see_the_success_message - expect(page).to have_content('About the accredited provider updated') + expect(page).to have_content('About the accredited partner updated') end def and_i_see_the_remove_success_message - expect(page).to have_content('Accredited provider removed') + expect(page).to have_content('Accredited partner removed') end def then_i_should_be_taken_to_the_index_page @@ -174,7 +174,7 @@ def then_i_should_be_taken_to_the_index_page def when_i_confirm_the_changes expect do - click_link_or_button 'Add accredited provider' + click_link_or_button 'Add accredited partner' end.to have_enqueued_email(Users::OrganisationMailer, :added_as_an_organisation_to_training_partner) end @@ -189,12 +189,12 @@ def then_i_should_see_the_different_information alias_method :then_i_should_see_the_description, :then_i_should_see_the_information_i_added def when_i_input_some_information - fill_in 'About the accredited provider', with: 'This is a description' + fill_in 'About the accredited partner', with: 'This is a description' click_continue end def when_i_input_some_different_information - fill_in 'About the accredited provider', with: 'updates to the AP description' + fill_in 'About the accredited partner', with: 'updates to the AP description' click_link_or_button 'Update description' end @@ -243,19 +243,19 @@ def when_i_search_for_an_accredited_provider_with_a_valid_query click_continue end - def when_i_click_add_accredited_provider - click_link_or_button 'Add accredited provider' + def when_i_click_add_accredited_partner + click_link_or_button 'Add accredited partner' end - def then_i_see_the_correct_text_for_no_accredited_providers - expect(page).to have_text("There are no accredited providers for #{@provider.provider_name}") + def then_i_see_the_correct_text_for_no_accredited_partners + expect(page).to have_text("There are no accredited partners for #{@provider.provider_name}") end - def when_i_click_on_the_accredited_provider_tab - click_link_or_button 'Accredited provider' + def when_i_click_on_the_accredited_partners_tab + click_link_or_button 'Accredited partner' end - alias_method :and_i_click_on_the_accredited_provider_tab, :when_i_click_on_the_accredited_provider_tab + alias_method :and_i_click_on_the_accredited_partners_tab, :when_i_click_on_the_accredited_partners_tab def and_i_visit_the_root_path visit root_path @@ -276,8 +276,8 @@ def click_continue alias_method :and_i_continue_without_entering_a_description, :click_continue - def and_my_provider_has_accrediting_providers - course = build(:course, accrediting_provider: build(:provider, :accredited_provider, provider_name: 'Accrediting provider name')) + def and_my_provider_has_accrediting_partners + course = build(:course, accrediting_provider: build(:provider, :accredited_provider, provider_name: 'Accrediting partner name')) @provider.courses << course @provider.update( @@ -287,7 +287,7 @@ def and_my_provider_has_accrediting_providers ) end - def then_i_should_see_the_accredited_provider_name_displayed - expect(page).to have_css('h2', text: 'Accrediting provider name') + def then_i_should_see_the_accredited_partners_name_displayed + expect(page).to have_css('h2', text: 'Accrediting partner name') end end diff --git a/spec/features/support/providers/accredited_providers_spec.rb b/spec/features/support/providers/accredited_providers_spec.rb index f83f5a008a..da127a6c36 100644 --- a/spec/features/support/providers/accredited_providers_spec.rb +++ b/spec/features/support/providers/accredited_providers_spec.rb @@ -62,15 +62,15 @@ def and_i_see_the_remove_success_message def and_i_see_the_remove_success_message; end def and_i_click_remove_ap - click_link_or_button 'Remove accredited provider' + click_link_or_button 'Remove accredited partner' end def and_i_confirm_the_changes - click_link_or_button 'Add accredited provider' + click_link_or_button 'Add accredited partner' end def when_i_input_new_information - fill_in 'About the accredited provider', with: 'New AP description' + fill_in 'About the accredited partner', with: 'New AP description' click_link_or_button 'Continue' end @@ -89,7 +89,7 @@ def and_i_search_for_an_accredited_provider_with_a_valid_query end def and_i_click_add_accredited_provider - click_link_or_button 'Add accredited provider' + click_link_or_button 'Add accredited partner' end def and_i_click_remove @@ -97,7 +97,7 @@ def and_i_click_remove end def then_i_should_see_the_cannot_remove_text - expect(page).to have_css('h1', text: 'You cannot remove this accredited provider') + expect(page).to have_css('h1', text: 'You cannot remove this accredited partner') end def given_i_am_authenticated_as_an_admin_user @@ -134,7 +134,7 @@ def when_i_click_the_back_link end def and_i_see_the_success_message - expect(page).to have_content('About the accredited provider updated') + expect(page).to have_content('About the accredited partner updated') end def then_i_should_see_the_updated_description @@ -142,12 +142,12 @@ def then_i_should_see_the_updated_description end def when_i_input_updated_description - fill_in 'About the accredited provider', with: 'update the AP description' + fill_in 'About the accredited partner', with: 'update the AP description' click_link_or_button 'Update description' end def then_i_see_the_correct_text_for_no_accredited_providers - expect(page).to have_text("There are no accredited providers for #{@provider.provider_name}") + expect(page).to have_text("There are no accredited partners for #{@provider.provider_name}") end def and_i_click_on_the_accredited_provider_tab @@ -155,7 +155,7 @@ def and_i_click_on_the_accredited_provider_tab end def and_my_provider_has_accrediting_providers - course = build(:course, accrediting_provider: build(:provider, :accredited_provider, provider_name: 'Accrediting provider name')) + course = build(:course, accrediting_provider: build(:provider, :accredited_provider, provider_name: 'Accrediting partner name')) @provider.courses << course @provider.update( @@ -168,7 +168,7 @@ def and_my_provider_has_accrediting_providers def then_i_should_see_the_accredited_provider_name_displayed expect(page).to have_css( 'h2.govuk-summary-card__title a.govuk-link', - text: 'Accrediting provider name' + text: 'Accrediting partner name' ) end end diff --git a/spec/models/course/publishable_spec.rb b/spec/models/course/publishable_spec.rb index 6f4fae5245..4df135b0be 100644 --- a/spec/models/course/publishable_spec.rb +++ b/spec/models/course/publishable_spec.rb @@ -15,7 +15,7 @@ expect(course).not_to be_publishable expect(course.errors.messages).to eq( { sites: ['^Select at least one school'], - accrediting_provider: ['Select an accredited provider'], + accrediting_provider: ['Select a ratifying partner'], about_course: ['^Enter information about this course'], how_school_placements_work: ['^Enter details about how placements work'], course_length: ['^Enter a course length'], @@ -24,7 +24,7 @@ ) end - context 'when associated accredited provider is no longer accredited' do + context 'when associated accredited partner is no longer accredited' do let(:enrichment) { build(:course_enrichment, :subsequent_draft, created_at: 1.day.ago) } let(:primary_with_mathematics) { find_or_create(:primary_subject, :primary_with_mathematics) } let(:course) do diff --git a/spec/support/page_objects/find/course_show.rb b/spec/support/page_objects/find/course_show.rb index cea512025e..c73769a80c 100644 --- a/spec/support/page_objects/find/course_show.rb +++ b/spec/support/page_objects/find/course_show.rb @@ -8,7 +8,7 @@ class CourseShow < PageObjects::Base element :page_heading, '.govuk-heading-xl' element :sub_title, '[data-qa=course__provider_name]' element :extended_qualification_descriptions, '[data-qa=course__extended_qualification_descriptions]' - element :accredited_provider, '[data-qa=course__accredited_provider]' + element :accredited_provider, '[data-qa=course__ratifying_partner]' element :provider_website, '[data-qa=course__provider_website]' element :vacancies, '[data-qa=course__vacancies]' element :about_course, '[data-qa=course__about_course]' diff --git a/spec/support/page_objects/publish/course_confirmation.rb b/spec/support/page_objects/publish/course_confirmation.rb index 7ae0af9e97..c14e441ce7 100644 --- a/spec/support/page_objects/publish/course_confirmation.rb +++ b/spec/support/page_objects/publish/course_confirmation.rb @@ -24,7 +24,7 @@ class SummaryList < SitePrism::Section section :study_mode, SummaryList, '[data-qa=course__study_mode]' section :schools, SummaryList, '[data-qa=course__schools]' section :study_sites, SummaryList, '[data-qa=course__study_sites]' - section :accredited_provider, SummaryList, '[data-qa=course__accredited_provider]' + section :accredited_provider, SummaryList, '[data-qa=course__ratifying_partner]' section :applications_open, SummaryList, '[data-qa=course__applications_open]' section :start_date, SummaryList, '[data-qa=course__start_date]' section :name, SummaryList, '[data-qa=course__name]' diff --git a/spec/support/page_objects/publish/course_preview.rb b/spec/support/page_objects/publish/course_preview.rb index 9fb4565128..e423958db9 100644 --- a/spec/support/page_objects/publish/course_preview.rb +++ b/spec/support/page_objects/publish/course_preview.rb @@ -7,7 +7,7 @@ class CoursePreview < PageObjects::Base element :sub_title, '[data-qa=course__provider_name]' element :description, '[data-qa=course__description]' - element :accredited_provider, '[data-qa=course__accredited_provider]' + element :accredited_provider, '[data-qa=course__ratifying_partner]' element :provider_website, '[data-qa=course__provider_website]' element :vacancies, '[data-qa=course__vacancies]' element :about_course, '[data-qa=course__about_course]' diff --git a/spec/support/page_objects/publish/courses/accredited_providers.rb b/spec/support/page_objects/publish/courses/accredited_providers.rb index cfdb2b7291..5c4169f546 100644 --- a/spec/support/page_objects/publish/courses/accredited_providers.rb +++ b/spec/support/page_objects/publish/courses/accredited_providers.rb @@ -6,7 +6,7 @@ module Courses class AccreditedProviders < PageObjects::Base set_url '/publish/organisations/{provider_code}/{recruitment_cycle_year}/courses/{course_code}/accredited-provider' - elements :suggested_accredited_bodies, '[data-qa="course__accredited_provider_option"]' + elements :suggested_accredited_bodies, '[data-qa="course__ratifying_partner_option"]' element :add_new_link, '[data-qa="course__add"]' element :update_button, 'input[type=submit]' diff --git a/spec/support/page_objects/publish/courses/new_accredited_provider.rb b/spec/support/page_objects/publish/courses/new_ratifying_partner.rb similarity index 84% rename from spec/support/page_objects/publish/courses/new_accredited_provider.rb rename to spec/support/page_objects/publish/courses/new_ratifying_partner.rb index f31ddc655e..96eb3312cf 100644 --- a/spec/support/page_objects/publish/courses/new_accredited_provider.rb +++ b/spec/support/page_objects/publish/courses/new_ratifying_partner.rb @@ -3,10 +3,10 @@ module PageObjects module Publish module Courses - class NewAccreditedProvider < PageObjects::Base + class NewRatifyingPartner < PageObjects::Base set_url '/publish/organisations/{provider_code}/{recruitment_cycle_year}/courses/accredited-provider/new{?query*}' - elements :suggested_accredited_bodies, '[data-qa="course__accredited_provider_option"]' + elements :suggested_accredited_bodies, '[data-qa="course__ratifying_partner_option"]' element :continue, '[data-qa="course__save"]' element :about_section_input, 'textarea' diff --git a/spec/support/page_objects/publish/provider_courses_details.rb b/spec/support/page_objects/publish/provider_courses_details.rb index 0d117e1286..0e349ca058 100644 --- a/spec/support/page_objects/publish/provider_courses_details.rb +++ b/spec/support/page_objects/publish/provider_courses_details.rb @@ -19,7 +19,7 @@ class ProviderCoursesDetails < PageObjects::Base section :funding, Sections::SummaryList, '[data-qa="course__funding"]' section :study_mode, Sections::SummaryList, '[data-qa="course__study_mode"]' section :schools, Sections::SummaryList, '[data-qa="course__schools"]' - section :accredited_provider, Sections::SummaryList, '[data-qa="course__accredited_provider"]' + section :accredited_provider, Sections::SummaryList, '[data-qa="course__ratifying_partner"]' section :applications_open, Sections::SummaryList, '[data-qa="course__applications_open"]' section :start_date, Sections::SummaryList, '[data-qa="course__start_date"]' section :contact_support_link, Sections::SummaryList, '[data-qa="course__contact_support_link"]'