summaryrefslogtreecommitdiff
path: root/qa/spec/runtime/env_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/runtime/env_spec.rb')
-rw-r--r--qa/spec/runtime/env_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb
index 851026c71f0..ccc0b906845 100644
--- a/qa/spec/runtime/env_spec.rb
+++ b/qa/spec/runtime/env_spec.rb
@@ -77,6 +77,31 @@ describe QA::Runtime::Env do
end
end
+ describe '.forker?' do
+ it 'returns false if no forker credentials are defined' do
+ expect(described_class).not_to be_forker
+ end
+
+ it 'returns false if only forker username is defined' do
+ stub_env('GITLAB_FORKER_USERNAME', 'foo')
+
+ expect(described_class).not_to be_forker
+ end
+
+ it 'returns false if only forker password is defined' do
+ stub_env('GITLAB_FORKER_PASSWORD', 'bar')
+
+ expect(described_class).not_to be_forker
+ end
+
+ it 'returns true if forker username and password are defined' do
+ stub_env('GITLAB_FORKER_USERNAME', 'foo')
+ stub_env('GITLAB_FORKER_PASSWORD', 'bar')
+
+ expect(described_class).to be_forker
+ end
+ end
+
describe '.github_access_token' do
it 'returns "" if GITHUB_ACCESS_TOKEN is not defined' do
expect(described_class.github_access_token).to eq('')