From 7e55c2a57f246ccd6f338c1fdaf1f837ebff55b4 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Tue, 19 Jul 2022 15:17:28 +0100 Subject: [PATCH] Add "Add location" button --- app/views/locations/index.html.erb | 1 + spec/features/schemes_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index f8b02397d..d65d5930a 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -52,5 +52,6 @@ <% end %> <% end %> <% end %> +<%= govuk_button_link_to "Add a location", new_location_path(id: @scheme.id), secondary: true %> <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "locations" } %> diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index f3495dc35..763edd66e 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -243,6 +243,16 @@ RSpec.describe "Schemes scheme Features" do end end + context "when the user clicks add location" do + before do + click_link("Locations") + click_link("Add a location") + end + + it "shows the new location form" do + expect(page).to have_content("Add a location to this scheme") + end + end end end end