diff --git a/app/components/add_course_button_partnerships.rb b/app/components/add_course_button_partnerships.rb index 10c1635e1b..5a39e807d8 100644 --- a/app/components/add_course_button_partnerships.rb +++ b/app/components/add_course_button_partnerships.rb @@ -22,7 +22,7 @@ def incomplete_sections def incomplete_sections_hash { site_not_present?: publish_provider_recruitment_cycle_schools_path(provider.provider_code, provider.recruitment_cycle_year), - accredited_partner_not_present?: publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, provider.recruitment_cycle_year) + accredited_partner_not_present?: publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, provider.recruitment_cycle_year) } end diff --git a/app/controllers/publish/providers/provider_partnerships/checks_controller.rb b/app/controllers/publish/providers/accredited_partnerships/checks_controller.rb similarity index 82% rename from app/controllers/publish/providers/provider_partnerships/checks_controller.rb rename to app/controllers/publish/providers/accredited_partnerships/checks_controller.rb index 37f24f629f..1b05c6a232 100644 --- a/app/controllers/publish/providers/provider_partnerships/checks_controller.rb +++ b/app/controllers/publish/providers/accredited_partnerships/checks_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - module ProviderPartnerships + module AccreditedPartnerships class ChecksController < PublishController def show provider_partnership_form @@ -14,7 +14,7 @@ def update if @partnership.save notify_accredited_provider_users - redirect_to publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year), flash: { success: 'Accredited partnership added' } + redirect_to publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year), flash: { success: 'Accredited partnership added' } else render :show end diff --git a/app/controllers/publish/providers/provider_partnerships_controller.rb b/app/controllers/publish/providers/accredited_partnerships_controller.rb similarity index 83% rename from app/controllers/publish/providers/provider_partnerships_controller.rb rename to app/controllers/publish/providers/accredited_partnerships_controller.rb index b091524cc2..8407ff4553 100644 --- a/app/controllers/publish/providers/provider_partnerships_controller.rb +++ b/app/controllers/publish/providers/accredited_partnerships_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class ProviderPartnershipsController < PublishController + class AccreditedPartnershipsController < PublishController helper_method :accredited_provider_id def index; end @@ -23,7 +23,7 @@ def create @provider_partnership_form = ProviderPartnershipForm.new(current_user, @provider_partnership, params: partnership_params) if @provider_partnership_form.stash - redirect_to check_publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, recruitment_cycle.year) + redirect_to check_publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, recruitment_cycle.year) else render :new end @@ -35,7 +35,7 @@ def update if @provider_partnership_form.save! flash[:success] = t('publish.providers.provider_partnerships.edit.updated') - redirect_to publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, recruitment_cycle.year) + redirect_to publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, recruitment_cycle.year) else render :edit end @@ -51,7 +51,7 @@ def destroy if @partnership.destroy flash[:success] = t('publish.providers.provider_partnerships.delete.updated') - redirect_to publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, recruitment_cycle.year) + redirect_to publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, recruitment_cycle.year) else render :delete end diff --git a/app/controllers/publish/providers/accredited_provider_search_controller.rb b/app/controllers/publish/providers/accredited_provider_search_controller.rb index acb9b210c9..4c18fb0c08 100644 --- a/app/controllers/publish/providers/accredited_provider_search_controller.rb +++ b/app/controllers/publish/providers/accredited_provider_search_controller.rb @@ -12,7 +12,7 @@ def new def create if accredited_provider_id.present? if Settings.features.provider_partnerships - redirect_to new_publish_provider_recruitment_cycle_provider_partnership_path( + redirect_to new_publish_provider_recruitment_cycle_accredited_partnership_path( provider_code: provider.provider_code, recruitment_cycle_year: provider.recruitment_cycle_year, accredited_provider_id: @@ -43,7 +43,7 @@ def update if @accredited_provider_select_form.valid? if Settings.features.provider_partnerships - redirect_to new_publish_provider_recruitment_cycle_provider_partnership_path( + redirect_to new_publish_provider_recruitment_cycle_accredited_partnership_path( provider_code: provider.provider_code, recruitment_cycle_year: provider.recruitment_cycle_year, accredited_provider_id: accredited_provider_select_params[:provider_id] diff --git a/app/helpers/goto_confirmation_helper.rb b/app/helpers/goto_confirmation_helper.rb index d96cf1c8f0..9668ab8eb4 100644 --- a/app/helpers/goto_confirmation_helper.rb +++ b/app/helpers/goto_confirmation_helper.rb @@ -41,11 +41,11 @@ def back_link_for_adding_accredited_partner_path(param_form_key:, params:, recru def publish_back_link_for_adding_provider_partnership_path(param_form_key:, params:, recruitment_cycle_year:, provider:) with_partnerships = if goto_confirmation?(param_form_key:, params:) - check_publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, recruitment_cycle_year) + check_publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, recruitment_cycle_year) elsif param_form_key == :publish_accredited_provider_form - search_publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, recruitment_cycle_year) + search_publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, recruitment_cycle_year) else - publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, recruitment_cycle_year) + publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, recruitment_cycle_year) end return with_partnerships if Settings.features.provider_partnerships diff --git a/app/helpers/navigation_bar_helper.rb b/app/helpers/navigation_bar_helper.rb index ac2ed7d091..950e8ae964 100644 --- a/app/helpers/navigation_bar_helper.rb +++ b/app/helpers/navigation_bar_helper.rb @@ -23,7 +23,7 @@ def partnership_links(provider) if provider.accredited_provider? { name: t('navigation_bar.training_partners'), url: publish_provider_recruitment_cycle_training_providers_path(provider.provider_code, provider.recruitment_cycle_year) } else - { name: t('navigation_bar.accredited_partnerships'), url: publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, provider.recruitment_cycle_year) } + { name: t('navigation_bar.accredited_partnerships'), url: publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, provider.recruitment_cycle_year) } end elsif provider.accredited_provider? { name: t('navigation_bar.training_partners'), url: publish_provider_recruitment_cycle_training_providers_path(provider.provider_code, provider.recruitment_cycle_year) } diff --git a/app/views/publish/courses/_basic_details_tab.html.erb b/app/views/publish/courses/_basic_details_tab.html.erb index 7359c08e6b..27d250d7e9 100644 --- a/app/views/publish/courses/_basic_details_tab.html.erb +++ b/app/views/publish/courses/_basic_details_tab.html.erb @@ -156,7 +156,7 @@ heading = "Ratifying provider" partners = @provider.accredited_partners add_provider_text = "Add at least one accredited partner" - add_provider_link = publish_provider_recruitment_cycle_provider_partnerships_path(@course.provider_code, @course.recruitment_cycle_year) + add_provider_link = publish_provider_recruitment_cycle_accredited_partnerships_path(@course.provider_code, @course.recruitment_cycle_year) select_partner_text = "Select an accredited partner" select_partner_link = ratifying_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code) change_partner_link = ratifying_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code) diff --git a/app/views/publish/providers/provider_partnerships/_can_remove.html.erb b/app/views/publish/providers/accredited_partnerships/_can_remove.html.erb similarity index 81% rename from app/views/publish/providers/provider_partnerships/_can_remove.html.erb rename to app/views/publish/providers/accredited_partnerships/_can_remove.html.erb index cf3cd65069..6236954981 100644 --- a/app/views/publish/providers/provider_partnerships/_can_remove.html.erb +++ b/app/views/publish/providers/accredited_partnerships/_can_remove.html.erb @@ -1,7 +1,7 @@ <%= content_for :page_title, t("publish.providers.provider_partnerships.delete.title") %> <% content_for :before_content do %> - <%= govuk_back_link_to(publish_provider_recruitment_cycle_provider_partnerships_path) %> + <%= govuk_back_link_to(publish_provider_recruitment_cycle_accredited_partnerships_path) %> <% end %>
- <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_provider_partnerships_path) %> + <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_accredited_partnerships_path) %>
- <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_provider_partnerships_path) %> + <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_accredited_partnerships_path) %>
diff --git a/app/views/publish/providers/provider_partnerships/_hint.html.erb b/app/views/publish/providers/accredited_partnerships/_hint.html.erb similarity index 100% rename from app/views/publish/providers/provider_partnerships/_hint.html.erb rename to app/views/publish/providers/accredited_partnerships/_hint.html.erb diff --git a/app/views/publish/providers/provider_partnerships/checks/show.html.erb b/app/views/publish/providers/accredited_partnerships/checks/show.html.erb similarity index 82% rename from app/views/publish/providers/provider_partnerships/checks/show.html.erb rename to app/views/publish/providers/accredited_partnerships/checks/show.html.erb index 6cd72f8926..eb7ea6fe62 100644 --- a/app/views/publish/providers/provider_partnerships/checks/show.html.erb +++ b/app/views/publish/providers/accredited_partnerships/checks/show.html.erb @@ -3,14 +3,14 @@ ) %> <% content_for :before_content do %> - <%= govuk_back_link_to(new_publish_provider_recruitment_cycle_provider_partnership_path(provider_code: @provider.provider_code, + <%= govuk_back_link_to(new_publish_provider_recruitment_cycle_accredited_partnership_path(provider_code: @provider.provider_code, recruitment_cycle_year: @provider.recruitment_cycle_year)) %> <% end %>- <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) %> + <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) %>
- <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_provider_partnerships_path) %> + <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_accredited_partnerships_path) %>
There are no accredited providers for <%= @provider.provider_name %>.
<% else %> <% @provider.accredited_partnerships.each do |partnership| %> - <%= render AccreditedProviderComponent.new(provider_name: partnership.accredited_provider.provider_name, remove_path: delete_publish_provider_recruitment_cycle_provider_partnership_path(accredited_provider_code: partnership.accredited_provider.provider_code), about_accredited_provider: partnership.description, change_about_accredited_provider_path: edit_publish_provider_recruitment_cycle_provider_partnership_path(accredited_provider_code: partnership.accredited_provider.provider_code)) %> + <%= render AccreditedProviderComponent.new(provider_name: partnership.accredited_provider.provider_name, remove_path: delete_publish_provider_recruitment_cycle_accredited_partnership_path(accredited_provider_code: partnership.accredited_provider.provider_code), about_accredited_provider: partnership.description, change_about_accredited_provider_path: edit_publish_provider_recruitment_cycle_provider_partnership_path(accredited_provider_code: partnership.accredited_provider.provider_code)) %> <% end %> <% end %> diff --git a/app/views/publish/providers/provider_partnerships/new.html.erb b/app/views/publish/providers/accredited_partnerships/new.html.erb similarity index 90% rename from app/views/publish/providers/provider_partnerships/new.html.erb rename to app/views/publish/providers/accredited_partnerships/new.html.erb index 7f563a719c..50fb45acd7 100644 --- a/app/views/publish/providers/provider_partnerships/new.html.erb +++ b/app/views/publish/providers/accredited_partnerships/new.html.erb @@ -2,7 +2,7 @@ <%= form_with( model: @provider_partnership_form, - url: publish_provider_recruitment_cycle_provider_partnerships_path, + url: publish_provider_recruitment_cycle_accredited_partnerships_path, method: :post ) do |f| %> @@ -29,7 +29,7 @@ <%= f.govuk_submit t("continue") %>- <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_provider_partnerships_path) %> + <%= govuk_link_to(t("cancel"), publish_provider_recruitment_cycle_accredited_partnerships_path) %>
diff --git a/config/routes/publish.rb b/config/routes/publish.rb index cae733224a..0b2cc28b75 100644 --- a/config/routes/publish.rb +++ b/config/routes/publish.rb @@ -301,14 +301,14 @@ constraints(::Constraints::PartnershipFeature.new(:on)) do get '/publish/organisations/:provider_code/:recruitment_cycle_year/accredited-providers', to: redirect('/publish/organisations/:provider_code/:recruitment_cycle_year/provider-partnerships') - resources :provider_partnerships, param: :accredited_provider_code, except: %i[show], path: 'provider-partnerships', controller: 'provider_partnerships' do + resources :accredited_partnerships, param: :accredited_provider_code, except: %i[show], path: 'provider-partnerships', controller: 'accredited_partnerships' do member do get :delete - delete :delete, to: 'provider_partnerships#destroy' + delete :delete, to: 'accredited_partnerships#destroy' end - get '/check', on: :collection, to: 'provider_partnerships/checks#show' - put '/check', on: :collection, to: 'provider_partnerships/checks#update' + get '/check', on: :collection, to: 'accredited_partnerships/checks#show' + put '/check', on: :collection, to: 'accredited_partnerships/checks#update' end end diff --git a/spec/features/publish/accredited_partnership_spec.rb b/spec/features/publish/accredited_partnership_spec.rb index b5d4f84b90..3453f5e65a 100644 --- a/spec/features/publish/accredited_partnership_spec.rb +++ b/spec/features/publish/accredited_partnership_spec.rb @@ -126,11 +126,11 @@ def and_the_accredited_provider_is_saved_to_the_database end def then_i_should_be_taken_to_the_accredited_provider_description_page - expect(page).to have_current_path(new_publish_provider_recruitment_cycle_provider_partnership_path(@provider.provider_code, @provider.recruitment_cycle_year, goto_confirmation: true)) + expect(page).to have_current_path(new_publish_provider_recruitment_cycle_accredited_partnership_path(@provider.provider_code, @provider.recruitment_cycle_year, goto_confirmation: true)) end def then_i_should_be_taken_back_to_the_confirm_page - expect(page).to have_current_path(check_publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) + expect(page).to have_current_path(check_publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) end def when_i_click_the_back_link @@ -170,7 +170,7 @@ def and_i_see_the_remove_success_message end def then_i_should_be_taken_to_the_index_page - expect(page).to have_current_path(publish_provider_recruitment_cycle_provider_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) + expect(page).to have_current_path(publish_provider_recruitment_cycle_accredited_partnerships_path(@provider.provider_code, @provider.recruitment_cycle_year)) end def when_i_confirm_the_changes diff --git a/spec/helpers/navigation_bar_helper_spec.rb b/spec/helpers/navigation_bar_helper_spec.rb index 0f66abfb86..0f50220360 100644 --- a/spec/helpers/navigation_bar_helper_spec.rb +++ b/spec/helpers/navigation_bar_helper_spec.rb @@ -55,7 +55,7 @@ end it 'includes the correct link to accredited providers' do - expect(accredited_provider_item[:url]).to eq publish_provider_recruitment_cycle_provider_partnerships_path(provider.provider_code, provider.recruitment_cycle.year) + expect(accredited_provider_item[:url]).to eq publish_provider_recruitment_cycle_accredited_partnerships_path(provider.provider_code, provider.recruitment_cycle.year) end end end