summaryrefslogtreecommitdiff
path: root/qa/spec/runtime/env_spec.rb
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2018-02-12 12:48:31 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2018-02-12 12:48:31 -0600
commitc833a09d9156e26851746250460ddd2f091e73cd (patch)
tree01791c2a8461b53c797b3d5b91858f98b07eb477 /qa/spec/runtime/env_spec.rb
parent46ae03628de47d1bef2683a3a5fe4963b3df7d52 (diff)
parent0a22ff267b2d3d787d3da44d927caac7bd442832 (diff)
downloadgitlab-ce-c833a09d9156e26851746250460ddd2f091e73cd.tar.gz
Merge branch 'master' into jivl-update-katex
Diffstat (limited to 'qa/spec/runtime/env_spec.rb')
-rw-r--r--qa/spec/runtime/env_spec.rb21
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