|
|
|
@ -551,6 +551,12 @@ RSpec.describe "User Features" do
|
|
|
|
|
end |
|
|
|
|
context "when the user is logged in as a support user" do |
|
|
|
|
let!(:support_user) { FactoryBot.create(:user, :support) } |
|
|
|
|
let!(:test_org_1) { FactoryBot.create(:organisation, name: "Test1") } |
|
|
|
|
let!(:test_org_2) { FactoryBot.create(:organisation, name: "Test2") } |
|
|
|
|
let!(:test_org_3) { FactoryBot.create(:organisation, name: "Test3") } |
|
|
|
|
let!(:test_org_4) { FactoryBot.create(:organisation, name: "Test4") } |
|
|
|
|
let!(:test_org_5) { FactoryBot.create(:organisation, name: "Test5") } |
|
|
|
|
let!(:case_log) { FactoryBot.create(:case_log, owning_organisation_id: test_org_3.id, managing_organisation_id: test_org_3.id) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
FactoryBot.create_list(:organisation, 50) |
|
|
|
@ -573,6 +579,17 @@ RSpec.describe "User Features" do
|
|
|
|
|
expect(page).to have_css("#all-organisations-table") |
|
|
|
|
expect(page).to have_css(".app-pagination__link") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when the support user is on the organisations list page" do |
|
|
|
|
it "they can click on an organisation to see their logs page", js: true do |
|
|
|
|
visit("/organisations") |
|
|
|
|
click_link("Test3") |
|
|
|
|
expect(page).to have_selector("a", text: "#{case_log.id}") |
|
|
|
|
visit("/organisations") |
|
|
|
|
click_link("Test5") |
|
|
|
|
expect(page).not_to have_selector("a", text: "#{case_log.id}") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|