From c1c894d94958b410011b2f07b40d19b920fc555c Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 15 Jun 2022 14:21:21 +0100 Subject: [PATCH] testing back link --- spec/features/schemes_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index b2d96ff8e..46ee351e0 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -131,6 +131,21 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content(schemes.first.intended_stay_display) end + context "when I click to go back" do + before do + visit("schemes") + click_link(scheme.service_name) + end + + it "shows list of links to schemes" do + click_on("Back") + schemes.each do |scheme| + expect(page).to have_link(scheme.service_name) + expect(page).to have_content(scheme.primary_client_group_display) + end + end + end + context "when there are locations that belong to the selected scheme" do let!(:schemes) { FactoryBot.create_list(:scheme, 5) } let(:scheme) { schemes.first }