From d489f69d14e48578bcc0b9bf86d0d2841f4fbfa3 Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 14 Jun 2022 14:13:38 +0100 Subject: [PATCH] testing seeing locations --- spec/features/schemes_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 41467e49a..71869f635 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -133,6 +133,22 @@ RSpec.describe "Supported housing scheme Features" do expect(page).to have_link("Scheme") expect(page).to have_link("#{schemes.first.locations.count} locations") end + + context "there are locations that belong to the selected scheme" do + let!(:locations) { FactoryBot.create_list(:location, 3, scheme: schemes.first) } + + context "when I click locations link" do + before do + click_link ("#{schemes.first.locations.count} locations") + end + + it "shows details of those locations" do + locations.each do |location| + expect(page).to have_content(location.location_code) + end + end + end + end end end end