Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-07 15:06:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-07 15:06:21 +0300
commit84a0e65ac88c7a3db86a0e4347606ba093490bef (patch)
tree860de954548b509e92f6f95a66c8c75cf389efb0 /spec/lib/gitlab_spec.rb
parentbf3d94a7332ff411b654137a1d1288c399fceba4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab_spec.rb')
-rw-r--r--spec/lib/gitlab_spec.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb
index 6bf837f1d3f..9362ff72fbc 100644
--- a/spec/lib/gitlab_spec.rb
+++ b/spec/lib/gitlab_spec.rb
@@ -96,6 +96,48 @@ describe Gitlab do
end
end
+ describe '.canary?' do
+ it 'is true when CANARY env var is set to true' do
+ stub_env('CANARY', '1')
+
+ expect(described_class.canary?).to eq true
+ end
+
+ it 'is false when CANARY env var is set to false' do
+ stub_env('CANARY', '0')
+
+ expect(described_class.canary?).to eq false
+ end
+ end
+
+ describe '.com_and_canary?' do
+ it 'is true when on .com and canary' do
+ allow(described_class).to receive_messages(com?: true, canary?: true)
+
+ expect(described_class.com_and_canary?).to eq true
+ end
+
+ it 'is false when on .com but not on canary' do
+ allow(described_class).to receive_messages(com?: true, canary?: false)
+
+ expect(described_class.com_and_canary?).to eq false
+ end
+ end
+
+ describe '.com_but_not_canary?' do
+ it 'is false when on .com and canary' do
+ allow(described_class).to receive_messages(com?: true, canary?: true)
+
+ expect(described_class.com_but_not_canary?).to eq false
+ end
+
+ it 'is true when on .com but not on canary' do
+ allow(described_class).to receive_messages(com?: true, canary?: false)
+
+ expect(described_class.com_but_not_canary?).to eq true
+ end
+ end
+
describe '.dev_env_org_or_com?' do
it 'is true when on .com' do
allow(described_class).to receive_messages(com?: true, org?: false)