From 67d0306c92684007154f56ad567a10c91f7b2c38 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 1 Jul 2022 07:44:09 +0100 Subject: [PATCH] testing clickable locations link under correct context --- spec/features/schemes_spec.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 353697226..09af09750 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -412,6 +412,17 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "Check your changes before creating this scheme" end + context "when I select to view locations" do + before do + click_link "Locations" + end + + it "displays information about locations" do + expect(page).to have_content "Locations" + expect(page).to have_content "#{scheme.locations.count} locations" + end + end + context "and I select to create a scheme" do before do click_link "Create scheme" @@ -443,17 +454,6 @@ RSpec.describe "Schemes scheme Features" do end end end - - context "when I select to view locations" do - before do - click_link "/schemes/#{scheme.id}/check-answers#locations" - end - - it "displays information about locations" do - expect(page).to have_content "Locations" - expect(page).to have_content "#{scheme.locations.count} locations" - end - end end context "when changing answers" do