From b72fc4173955095e67c44f97f97f36b8927f127c Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 15 Jun 2022 11:13:52 +0100 Subject: [PATCH] testing all attributes on the page --- spec/requests/schemes_controller_spec.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 53ba369ba..a7ced9b21 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -274,7 +274,7 @@ RSpec.describe SchemesController, type: :request do context "when signed in as a data coordinator user" do let(:user) { FactoryBot.create(:user, :data_coordinator) } let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } - let!(:location) { FactoryBot.create(:location, scheme:) } + let!(:locations) { FactoryBot.create_list(:location, 3, scheme:) } before do sign_in user @@ -282,7 +282,16 @@ RSpec.describe SchemesController, type: :request do end it "shows scheme" do - expect(page).to have_content(location.location_code) + locations.each do |location| + expect(page).to have_content(location.location_code) + expect(page).to have_content(location.postcode) + expect(page).to have_content(location.county) + expect(page).to have_content(location.type_of_unit) + expect(page).to have_content(location.type_of_building) + expect(page).to have_content(location.wheelchair_adaptation_display) + expect(page).to have_content(location.address_line1) + expect(page).to have_content(location.address_line2) + end end end end