diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-09 14:34:10 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-09 14:34:10 +0000 |
commit | ce37a209c6394115eb77c01b877dfd3ae1a6e7e1 (patch) | |
tree | d24546b89574deb33b0df1237779d05a91bc8a5f /spec/lib | |
parent | 9fc9cd03a5381cc2cd8a72a89d67a04a6a5b8a9c (diff) | |
parent | cb5a5eb89265f7261ecc97b6de5bd26ca092960c (diff) | |
download | gitlab-ce-ce37a209c6394115eb77c01b877dfd3ae1a6e7e1.tar.gz |
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.rb | 6 |
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 |