From 2ca60421d48acbe763a0bf91576cf4d4623fc540 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Thu, 21 Jul 2022 15:00:17 +0100 Subject: [PATCH] Show location tab is location is being added to an existing scheme --- spec/features/schemes_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 51f9bdcf0..91edcd1a2 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -252,6 +252,25 @@ RSpec.describe "Schemes scheme Features" do it "shows the new location form" do expect(page).to have_content("Add a location to this scheme") end + + context "when the user completes the new location form" do + let(:location_name) { "Area 42" } + + before do + fill_in "Postcode", with: "NW1L 5DP" + fill_in "Location name (optional)", with: location_name + fill_in "Total number of units at this location", with: 1 + choose "Bungalow" + choose "location-wheelchair-adaptation-no-field" + choose "location-add-another-location-no-field" + click_button "Save and continue" + end + + it "shows the check answers page location tab" do + expect(page.current_url.split("/").last).to eq("check-answers#locations") + expect(page).to have_content(location_name) + end + end end end end