Browse Source

Add a merge organisation link

CLDC-2055-which-organisations-are-merging
Kat 2 years ago
parent
commit
965cba2e24
  1. 3
      app/views/organisations/show.html.erb
  2. 4
      config/initializers/feature_toggle.rb
  3. 1
      config/routes.rb
  4. 5
      spec/requests/organisations_controller_spec.rb

3
app/views/organisations/show.html.erb

@ -35,6 +35,9 @@
<% end %> <% end %>
<% end %> <% end %>
<% if FeatureToggle.merge_organisations_enabled? %>
<p>Is your organisation merging with another? <%= govuk_link_to "Let us know using this form", merge_organisation_path %></p>
<% end %>
</div> </div>
<div class="govuk-grid-column-one-third-from-desktop"> <div class="govuk-grid-column-one-third-from-desktop">

4
config/initializers/feature_toggle.rb

@ -53,4 +53,8 @@ class FeatureToggle
def self.collection_2023_2024_year_enabled? def self.collection_2023_2024_year_enabled?
true true
end end
def self.merge_organisations_enabled?
!Rails.env.production?
end
end end

1
config/routes.rb

@ -119,6 +119,7 @@ Rails.application.routes.draw do
get "managing-agents/remove", to: "organisation_relationships#remove_managing_agent" get "managing-agents/remove", to: "organisation_relationships#remove_managing_agent"
post "managing-agents", to: "organisation_relationships#create_managing_agent" post "managing-agents", to: "organisation_relationships#create_managing_agent"
delete "managing-agents", to: "organisation_relationships#delete_managing_agent" delete "managing-agents", to: "organisation_relationships#delete_managing_agent"
get "merge", to: "organisations#merge"
end end
end end

5
spec/requests/organisations_controller_spec.rb

@ -227,6 +227,11 @@ RSpec.describe OrganisationsController, type: :request do
expected_html = "data-qa=\"change-name\" href=\"/organisations/#{organisation.id}/edit\"" expected_html = "data-qa=\"change-name\" href=\"/organisations/#{organisation.id}/edit\""
expect(response.body).to include(expected_html) expect(response.body).to include(expected_html)
end end
it "displays a link to merge organisations" do
expect(page).to have_content("Is your organisation merging with another?")
expect(page).to have_link("Let us know using this form", href: "/organisations/#{organisation.id}/merge")
end
end end
context "with organisation that are not in scope for the user, i.e. that they do not belong to" do context "with organisation that are not in scope for the user, i.e. that they do not belong to" do

Loading…
Cancel
Save