Browse Source

added test to check locations

pull/719/head
JG 3 years ago
parent
commit
e0b470107b
  1. 6
      db/seeds.rb
  2. 12
      spec/features/schemes_spec.rb

6
db/seeds.rb

@ -79,7 +79,7 @@ unless Rails.env.test?
intended_stay: "M", intended_stay: "M",
primary_client_group: "O", primary_client_group: "O",
secondary_client_group: "H", secondary_client_group: "H",
organisation: org, owning_organisation: org,
created_at: Time.zone.now, created_at: Time.zone.now,
) )
@ -92,7 +92,7 @@ unless Rails.env.test?
intended_stay: "S", intended_stay: "S",
primary_client_group: "D", primary_client_group: "D",
secondary_client_group: "E", secondary_client_group: "E",
organisation: org, owning_organisation: org,
created_at: Time.zone.now, created_at: Time.zone.now,
) )
@ -105,7 +105,7 @@ unless Rails.env.test?
intended_stay: "X", intended_stay: "X",
primary_client_group: "G", primary_client_group: "G",
secondary_client_group: "R", secondary_client_group: "R",
organisation: dummy_org, owning_organisation: dummy_org,
created_at: Time.zone.now, created_at: Time.zone.now,
) )

12
spec/features/schemes_spec.rb

@ -681,6 +681,7 @@ RSpec.describe "Schemes scheme Features" do
context "when I click to see individual scheme" do context "when I click to see individual scheme" do
let(:scheme) { schemes.first } let(:scheme) { schemes.first }
let!(:location) { FactoryBot.create(:location, scheme: scheme) }
before do before do
click_link(scheme.service_name) click_link(scheme.service_name)
@ -721,6 +722,17 @@ RSpec.describe "Schemes scheme Features" do
end end
end 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 end
end end

Loading…
Cancel
Save