Browse Source

Add a cancel button to add stock owners/managing organisations page (#1741)

pull/1751/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
247a1a8560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/views/organisation_relationships/add_managing_agent.html.erb
  2. 3
      app/views/organisation_relationships/add_stock_owner.html.erb
  3. 10
      spec/requests/organisation_relationships_controller_spec.rb

3
app/views/organisation_relationships/add_managing_agent.html.erb

@ -22,7 +22,10 @@
question: Form::Question.new("", { "answer_options" => answer_options }, nil), question: Form::Question.new("", { "answer_options" => answer_options }, nil),
f:, f:,
} %> } %>
<div class="govuk-button-group govuk-!-margin-bottom-6">
<%= f.govuk_submit "Add" %> <%= f.govuk_submit "Add" %>
<%= govuk_button_link_to("Cancel", managing_agents_organisation_path(@organisation), secondary: true) %>
</div>
<%= govuk_details(summary_text: "Can't find the managing agent you're looking for?") do %> <%= govuk_details(summary_text: "Can't find the managing agent you're looking for?") do %>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Double check the spelling and try again</li> <li>Double check the spelling and try again</li>

3
app/views/organisation_relationships/add_stock_owner.html.erb

@ -22,7 +22,10 @@
question: Form::Question.new("", { "answer_options" => answer_options }, nil), question: Form::Question.new("", { "answer_options" => answer_options }, nil),
f:, f:,
} %> } %>
<div class="govuk-button-group govuk-!-margin-bottom-6">
<%= f.govuk_submit "Add" %> <%= f.govuk_submit "Add" %>
<%= govuk_button_link_to("Cancel", stock_owners_organisation_path(@organisation), secondary: true) %>
</div>
<%= govuk_details(summary_text: "Can't find the stock owner you're looking for?") do %> <%= govuk_details(summary_text: "Can't find the stock owner you're looking for?") do %>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Double check the spelling and try again</li> <li>Double check the spelling and try again</li>

10
spec/requests/organisation_relationships_controller_spec.rb

@ -62,6 +62,10 @@ RSpec.describe OrganisationRelationshipsController, type: :request do
it "shows an add button" do it "shows an add button" do
expect(page).to have_button("Add") expect(page).to have_button("Add")
end end
it "shows a cancel button" do
expect(page).to have_link("Cancel", href: "/organisations/#{organisation.id}/stock-owners")
end
end end
end end
@ -640,7 +644,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do
expect(response.body).to include("Remove") expect(response.body).to include("Remove")
end end
context "when adding a stock owner" do context "when adding a managing agent" do
before do before do
get "/organisations/#{organisation.id}/managing-agents/add", headers:, params: {} get "/organisations/#{organisation.id}/managing-agents/add", headers:, params: {}
end end
@ -652,6 +656,10 @@ RSpec.describe OrganisationRelationshipsController, type: :request do
it "shows an add button" do it "shows an add button" do
expect(page).to have_button("Add") expect(page).to have_button("Add")
end end
it "shows a cancel button" do
expect(page).to have_link("Cancel", href: "/organisations/#{organisation.id}/managing-agents")
end
end end
end end
end end

Loading…
Cancel
Save