Browse Source

Add merge page

CLDC-2055-which-organisations-are-merging
Kat 2 years ago
parent
commit
b6c222a0c7
  1. 2
      app/helpers/navigation_items_helper.rb
  2. 55
      app/views/organisations/merge.html.erb
  3. 30
      spec/requests/organisations_controller_spec.rb

2
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)

55
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? %>
<h1 class="govuk-heading-l"><%= @organisation.name %></h1>
<% if current_user.support? %>
<%= render SubNavigationComponent.new(
items: secondary_items(request.path, @organisation.id),
) %>
<% end %>
<% end %>
<%= govuk_back_link href: organisation_path %>
<h2 class="govuk-heading-l">Tell us if your organisation is merging</h2>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<p class="govuk-body">
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.
</p>
<h2 class="govuk-heading-m">Before you start</h2>
<span class="govuk-body">Regardless of the merge type, you’ll be asked for:</span>
<ul class="govuk-list govuk-list--bullet">
<li>the organisations merging in CORE</li>
<li>the merge type: for example one organisation absorbing the rest, or them all creating a new organisation</li>
<li>to confirm or update the telephone number</li>
<li>the merge date</li>
<li>if user email addresses will change with this merge</li>
</ul>
<h2 class="govuk-heading-m">If email addresses are changing</h2>
<%= 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. ") %>
<p class="govuk-body">
Users must have access to their old email address, so they can confirm their new one.
</p>
<h2 class="govuk-heading-m">If merging into a new organisation</h2>
<span class="govuk-body">You'll also be asked for the new organisation’s:</span>
<ul class="govuk-list govuk-list--bullet">
<li>name</li>
<li>address</li>
<li>telephone number</li>
<li>housing provider type</li>
<li>Regulator of Social Housing registration number</li>
<li>held stock details</li>
</ul>
<%= 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: "#",
) %>
</div>
</div>

30
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

Loading…
Cancel
Save