diff options
author | Stan Hu <stanhu@gmail.com> | 2018-02-10 14:20:44 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-02-11 05:59:33 -0800 |
commit | dc8cf732078dc03af52e4821683ea1c04946091e (patch) | |
tree | e650e989b486fc09dc1ab100087600f2206fcb92 /qa/spec/runtime/env_spec.rb | |
parent | 498ade4801a822f8704390b10d178af9fe7987cb (diff) | |
download | gitlab-ce-dc8cf732078dc03af52e4821683ea1c04946091e.tar.gz |
GitLab QA: Add GITLAB_USER_TYPE to support different login types (e.g. standard, LDAP)sh-add-login-types-qa
GITLAB_USERNAME and GITLAB_PASSWORD may be specified for an LDAP login, but QA
scenarios may need to know which type it is in order to log in successfully.
Diffstat (limited to 'qa/spec/runtime/env_spec.rb')
-rw-r--r-- | qa/spec/runtime/env_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index 103573db6be..2b6365dbc41 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -55,4 +55,25 @@ describe QA::Runtime::Env do end end end + + describe '.user_type' do + it 'returns standard if not defined' do + expect(described_class.user_type).to eq('standard') + end + + it 'returns standard as defined' do + stub_env('GITLAB_USER_TYPE', 'standard') + expect(described_class.user_type).to eq('standard') + end + + it 'returns ldap as defined' do + stub_env('GITLAB_USER_TYPE', 'ldap') + expect(described_class.user_type).to eq('ldap') + end + + it 'returns an error if invalid user type' do + stub_env('GITLAB_USER_TYPE', 'foobar') + expect { described_class.user_type }.to raise_error(ArgumentError) + end + end end |