Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/auth/request_authenticator_spec.rb')
-rw-r--r--spec/lib/gitlab/auth/request_authenticator_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/lib/gitlab/auth/request_authenticator_spec.rb b/spec/lib/gitlab/auth/request_authenticator_spec.rb
index 6f3d6187076..5e9d07a8bf7 100644
--- a/spec/lib/gitlab/auth/request_authenticator_spec.rb
+++ b/spec/lib/gitlab/auth/request_authenticator_spec.rb
@@ -21,8 +21,10 @@ RSpec.describe Gitlab::Auth::RequestAuthenticator do
let_it_be(:session_user) { build(:user) }
it 'returns sessionless user first' do
- allow_any_instance_of(described_class).to receive(:find_sessionless_user).and_return(sessionless_user)
- allow_any_instance_of(described_class).to receive(:find_user_from_warden).and_return(session_user)
+ allow_next_instance_of(described_class) do |instance|
+ allow(instance).to receive(:find_sessionless_user).and_return(sessionless_user)
+ allow(instance).to receive(:find_user_from_warden).and_return(session_user)
+ end
expect(subject.user([:api])).to eq sessionless_user
end