From e0b470107ba7aa33831c102225f613bafe326ff9 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 8 Jul 2022 10:02:08 +0100 Subject: [PATCH] added test to check locations --- db/seeds.rb | 6 +++--- spec/features/schemes_spec.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 175922921..54ba854b3 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -79,7 +79,7 @@ unless Rails.env.test? intended_stay: "M", primary_client_group: "O", secondary_client_group: "H", - organisation: org, + owning_organisation: org, created_at: Time.zone.now, ) @@ -92,7 +92,7 @@ unless Rails.env.test? intended_stay: "S", primary_client_group: "D", secondary_client_group: "E", - organisation: org, + owning_organisation: org, created_at: Time.zone.now, ) @@ -105,7 +105,7 @@ unless Rails.env.test? intended_stay: "X", primary_client_group: "G", secondary_client_group: "R", - organisation: dummy_org, + owning_organisation: dummy_org, created_at: Time.zone.now, ) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 5999d09a0..880e8ceb5 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -681,6 +681,7 @@ RSpec.describe "Schemes scheme Features" do context "when I click to see individual scheme" do let(:scheme) { schemes.first } + let!(:location) { FactoryBot.create(:location, scheme: scheme) } before do click_link(scheme.service_name) @@ -721,6 +722,17 @@ RSpec.describe "Schemes scheme Features" do end end end + + context "when I click to see locations" do + before do + click_link "1 location" + end + + it "I see location details" do + expect(page).to have_content scheme.locations.first.id + expect(page).to have_current_path("/schemes/#{scheme.id}/locations") + end + end end end end