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
path: root/spec/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-09 17:34:10 +0300
committerRémy Coutable <remy@rymai.me>2017-06-09 17:34:10 +0300
commitce37a209c6394115eb77c01b877dfd3ae1a6e7e1 (patch)
treed24546b89574deb33b0df1237779d05a91bc8a5f /spec/lib
parent9fc9cd03a5381cc2cd8a72a89d67a04a6a5b8a9c (diff)
parentcb5a5eb89265f7261ecc97b6de5bd26ca092960c (diff)
Merge branch 'pat-msg-on-auth-failure' into 'master'
Prompt user to create personal access token for Git over HTTP See merge request !11986
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/auth_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
index d6006eab0c9..d09da951869 100644
--- a/spec/lib/gitlab/auth_spec.rb
+++ b/spec/lib/gitlab/auth_spec.rb
@@ -204,6 +204,12 @@ describe Gitlab::Auth, lib: true do
expect(gl_auth).to receive(:rate_limit!).with('ip', success: false, login: login)
expect(gl_auth.find_for_git_client(login, 'bar', project: nil, ip: 'ip')).to eq(Gitlab::Auth::Result.new)
end
+
+ it 'throws an error suggesting user create a PAT when internal auth is disabled' do
+ allow_any_instance_of(ApplicationSetting).to receive(:signin_enabled?) { false }
+
+ expect { gl_auth.find_for_git_client('foo', 'bar', project: nil, ip: 'ip') }.to raise_error(Gitlab::Auth::MissingPersonalTokenError)
+ end
end
describe 'find_with_user_password' do