diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-18 17:05:42 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-07-06 14:22:00 +0200 |
commit | 2ad990bba0cce86bd2e44d2e91e73f874f0f0896 (patch) | |
tree | 852290af9cb31786a1fc62713d1b7737a5990edf /qa/spec | |
parent | 01796734d078f61c54e1af753564c01db91993f4 (diff) | |
download | gitlab-ce-2ad990bba0cce86bd2e44d2e91e73f874f0f0896.tar.gz |
[QA] Add a new scenario to test GitHub import
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/runtime/env_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index 2b6365dbc41..851026c71f0 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -76,4 +76,27 @@ describe QA::Runtime::Env do expect { described_class.user_type }.to raise_error(ArgumentError) 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('') + end + + it 'returns stripped string if GITHUB_ACCESS_TOKEN is defined' do + stub_env('GITHUB_ACCESS_TOKEN', ' abc123 ') + expect(described_class.github_access_token).to eq('abc123') + end + end + + describe '.require_github_access_token!' do + it 'raises ArgumentError if GITHUB_ACCESS_TOKEN is not defined' do + expect { described_class.require_github_access_token! }.to raise_error(ArgumentError) + end + + it 'does not raise if GITHUB_ACCESS_TOKEN is defined' do + stub_env('GITHUB_ACCESS_TOKEN', ' abc123 ') + + expect { described_class.require_github_access_token! }.not_to raise_error + end + end end |