summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2016-06-03 14:57:34 +0200
committerJacob Vosmaer <jacob@gitlab.com>2016-06-03 14:57:34 +0200
commit3ffa494ffe06105d6e36a46df52e8a842be0ab69 (patch)
treea8ffcd4598fc1ab7c094d7afc16430875bb28e70 /spec
parentfea591e5c5796235d28eeec4d27759f87fa9d8e2 (diff)
downloadgitlab-ce-3ffa494ffe06105d6e36a46df52e8a842be0ab69.tar.gz
Changes after more review from Rémy
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/auth_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
index 3c41c4b0681..a814ad2a4e7 100644
--- a/spec/lib/gitlab/auth_spec.rb
+++ b/spec/lib/gitlab/auth_spec.rb
@@ -11,7 +11,7 @@ describe Gitlab::Auth, lib: true do
ip = 'ip'
expect(gl_auth).to receive(:rate_limit!).with(ip, success: true, login: 'gitlab-ci-token')
- expect(gl_auth.find('gitlab-ci-token', token, project: project, ip: ip)).to eq([nil, :ci])
+ expect(gl_auth.find('gitlab-ci-token', token, project: project, ip: ip)).to eq(Gitlab::Auth::Result.new(nil, :ci))
end
it 'recognizes master passwords' do
@@ -19,7 +19,7 @@ describe Gitlab::Auth, lib: true do
ip = 'ip'
expect(gl_auth).to receive(:rate_limit!).with(ip, success: true, login: user.username)
- expect(gl_auth.find(user.username, 'password', project: nil, ip: ip)).to eq([user, :master_or_ldap])
+ expect(gl_auth.find(user.username, 'password', project: nil, ip: ip)).to eq(Gitlab::Auth::Result.new(user, :gitlab_or_ldap))
end
it 'recognizes OAuth tokens' do
@@ -29,7 +29,7 @@ describe Gitlab::Auth, lib: true do
ip = 'ip'
expect(gl_auth).to receive(:rate_limit!).with(ip, success: true, login: 'oauth2')
- expect(gl_auth.find("oauth2", token.token, project: nil, ip: ip)).to eq([user, :oauth])
+ expect(gl_auth.find("oauth2", token.token, project: nil, ip: ip)).to eq(Gitlab::Auth::Result.new(user, :oauth))
end
it 'returns double nil for invalid credentials' do
@@ -37,7 +37,7 @@ describe Gitlab::Auth, lib: true do
ip = 'ip'
expect(gl_auth).to receive(:rate_limit!).with(ip, success: false, login: login)
- expect(gl_auth.find(login, 'bar', project: nil, ip: ip)).to eq([nil, nil])
+ expect(gl_auth.find(login, 'bar', project: nil, ip: ip)).to eq(Gitlab::Auth::Result.new)
end
end