Browse Source

added empty feature for viewing user specific organisation

pull/627/head
Ted 3 years ago committed by JG
parent
commit
9b6dd82b2c
  1. 2
      spec/features/log_spec.rb
  2. 15
      spec/features/organisation_spec.rb

2
spec/features/log_spec.rb

@ -2,7 +2,7 @@ require "rails_helper"
RSpec.describe "Log Features" do
context "when searching for specific logs" do
context "when I am logged in and there are logs in the database" do
context "when I am signed in and there are logs in the database" do
let(:user) { FactoryBot.create(:user, last_sign_in_at: Time.zone.now) }
let!(:log_to_search) { FactoryBot.create(:case_log, owning_organisation: user.organisation) }
let!(:same_organisation_log) { FactoryBot.create(:case_log, owning_organisation: user.organisation) }

15
spec/features/organisation_spec.rb

@ -153,5 +153,20 @@ RSpec.describe "User Features" do
expect(page).not_to have_link first_log.id.to_s, href: "/logs/#{first_log.id}"
end
end
context "when I search for users belonging to a specific organisation" do
context "when I am signed in and there are users in the database" do
let(:user) { FactoryBot.create(:user, :support) }
let(:otp) { "999111" }
before do
allow(SecureRandom).to receive(:random_number).and_return(otp)
visit("/organisations")
fill_in("user[email]", with: user.email)
fill_in("user[password]", with: user.password)
click_button("Sign in")
fill_in("code", with: otp)
click_button("Submit")
end
end
end
end
end

Loading…
Cancel
Save