Browse Source

Update a organisation page test and lint

pull/557/head
Kat 3 years ago
parent
commit
c8adc8f67c
  1. 4
      spec/features/user_spec.rb
  2. 6
      spec/requests/organisations_controller_spec.rb

4
spec/features/user_spec.rb

@ -585,10 +585,10 @@ RSpec.describe "User Features" do
visit("/organisations")
click_link("Test3")
expect(page).to have_content("1 total logs")
expect(page).to have_selector("a", text: "#{case_log.id}")
expect(page).to have_selector("a", text: case_log.id.to_s)
visit("/organisations")
click_link("Test5")
expect(page).not_to have_selector("a", text: "#{case_log.id}")
expect(page).not_to have_selector("a", text: case_log.id.to_s)
end
end
end

6
spec/requests/organisations_controller_spec.rb

@ -300,15 +300,19 @@ RSpec.describe OrganisationsController, type: :request do
end
end
context "with a data provider user" do
context "with a support user" do
let(:user) { FactoryBot.create(:user, :support) }
before do
allow(user).to receive(:need_two_factor_authentication?).and_return(false)
sign_in user
get "/organisations"
end
it "shows all organisations" do
expect(page).to have_content("2 total organisations")
expect(page).to have_link organisation.name, href: "organisations/#{organisation.id}/logs"
expect(page).to have_link unauthorised_organisation.name, href: "organisations/#{unauthorised_organisation.id}/logs"
end
end
end

Loading…
Cancel
Save