summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
commit5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch)
treee5df8e0ceee60f4af8093f5c4c2f934b8abced05 /spec/lib/gitlab_spec.rb
parent4d477238500c347c6553d335d920bedfc5a46869 (diff)
downloadgitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
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)