|
|
@ -65,9 +65,9 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows only schemes belonging to the same organisation" do |
|
|
|
it "shows only schemes belonging to the same organisation" do |
|
|
|
expect(page).to have_content(same_org_scheme.id) |
|
|
|
expect(page).to have_content(same_org_scheme.id_to_display) |
|
|
|
schemes.each do |scheme| |
|
|
|
schemes.each do |scheme| |
|
|
|
expect(page).not_to have_content(scheme.id) |
|
|
|
expect(page).not_to have_content(scheme.id_to_display) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -82,9 +82,9 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "returns matching results" do |
|
|
|
it "returns matching results" do |
|
|
|
expect(page).to have_content(searched_scheme.id) |
|
|
|
expect(page).to have_content(searched_scheme.id_to_display) |
|
|
|
schemes.each do |scheme| |
|
|
|
schemes.each do |scheme| |
|
|
|
expect(page).not_to have_content(scheme.id) |
|
|
|
expect(page).not_to have_content(scheme.id_to_display) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -122,9 +122,9 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows only schemes belonging to the same organisation" do |
|
|
|
it "shows only schemes belonging to the same organisation" do |
|
|
|
expect(page).to have_content(same_org_scheme.id) |
|
|
|
expect(page).to have_content(same_org_scheme.id_to_display) |
|
|
|
schemes.each do |scheme| |
|
|
|
schemes.each do |scheme| |
|
|
|
expect(page).not_to have_content(scheme.id) |
|
|
|
expect(page).not_to have_content(scheme.id_to_display) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -142,7 +142,7 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
|
|
|
|
|
|
|
|
context "when searching" do |
|
|
|
context "when searching" do |
|
|
|
let!(:searched_scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:searched_scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let(:search_param) { searched_scheme.id } |
|
|
|
let(:search_param) { searched_scheme.id_to_display } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
FactoryBot.create(:location, scheme: searched_scheme) |
|
|
|
FactoryBot.create(:location, scheme: searched_scheme) |
|
|
@ -150,9 +150,9 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "returns matching results" do |
|
|
|
it "returns matching results" do |
|
|
|
expect(page).to have_content(searched_scheme.id) |
|
|
|
expect(page).to have_content(searched_scheme.id_to_display) |
|
|
|
schemes.each do |scheme| |
|
|
|
schemes.each do |scheme| |
|
|
|
expect(page).not_to have_content(scheme.id) |
|
|
|
expect(page).not_to have_content(scheme.id_to_display) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|