From 9b6dd82b2c345003dfedb30c58b358bc7bbc9e98 Mon Sep 17 00:00:00 2001 From: Ted Date: Mon, 30 May 2022 12:14:34 +0100 Subject: [PATCH] added empty feature for viewing user specific organisation --- spec/features/log_spec.rb | 2 +- spec/features/organisation_spec.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/spec/features/log_spec.rb b/spec/features/log_spec.rb index 2e8812b63..31b556a5b 100644 --- a/spec/features/log_spec.rb +++ b/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) } diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 8d00bf2dd..273023d67 100644 --- a/spec/features/organisation_spec.rb +++ b/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