diff --git a/app/helpers/navigation_items_helper.rb b/app/helpers/navigation_items_helper.rb index 8db369d59..3def5547f 100644 --- a/app/helpers/navigation_items_helper.rb +++ b/app/helpers/navigation_items_helper.rb @@ -101,7 +101,7 @@ private end def subnav_details_path?(path) - path.include?("/organisations") && path.include?("/details") + path.include?("/organisations") && (path.include?("/details") || path.include?("/merge")) end def stock_owners_path?(path) diff --git a/app/views/organisations/merge.html.erb b/app/views/organisations/merge.html.erb new file mode 100644 index 000000000..97ef5bcd0 --- /dev/null +++ b/app/views/organisations/merge.html.erb @@ -0,0 +1,55 @@ +<% title = "Tell us if your organisation is merging" %> +<% content_for :title, title %> + +<% if current_user.support? %> +

<%= @organisation.name %>

+ <% if current_user.support? %> + <%= render SubNavigationComponent.new( + items: secondary_items(request.path, @organisation.id), + ) %> + <% end %> +<% end %> + +<%= govuk_back_link href: organisation_path %> +

Tell us if your organisation is merging

+ +
+
+

+ Use this service to tell us if your organisation is merging with one or more other organisation. You can also use it to tell us about past merges that have not yet been reported to CORE. +

+ +

Before you start

+ Regardless of the merge type, you’ll be asked for: + + +

If email addresses are changing

+ <%= govuk_inset_text(text: "Update all user email addresses on CORE as soon as they change, so that everyone can still access their CORE account. ") %> +

+ Users must have access to their old email address, so they can confirm their new one. +

+ +

If merging into a new organisation

+ You'll also be asked for the new organisation’s: + + + <%= govuk_warning_text text: "You will not be able to submit your request without the above information. Do not start the form until you have obtained all of the information. " %> + <%= govuk_start_button( + text: "Start now", + href: "#", + ) %> +
+
diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index c663f2e08..459987fdc 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -440,6 +440,36 @@ RSpec.describe OrganisationsController, type: :request do expect { request }.not_to change(Organisation, :count) end end + + describe "#merge" do + context "with an organisation that the user belongs to" do + before do + get "/organisations/#{organisation.id}/merge", headers:, params: {} + end + + it "shows the correct content" do + expect(page).to have_content("Tell us if your organisation is merging") + end + + it "has a correct back link" do + expect(page).to have_link("Back", href: "/organisations/#{organisation.id}") + end + + it "has a correct start no button" do + expect(page).to have_link("Start now", href: "#") + end + end + + context "with organisation that are not in scope for the user, i.e. that they do not belong to" do + before do + get "/organisations/#{unauthorised_organisation.id}/merge", headers:, params: {} + end + + it "returns not found 404 from org details route" do + expect(response).to have_http_status(:not_found) + end + end + end end context "with a data provider user" do