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:
Diffstat (limited to 'spec/lib/gitlab_spec.rb')
-rw-r--r--spec/lib/gitlab_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb
index ccb5cb3aa43..7e318017a05 100644
--- a/spec/lib/gitlab_spec.rb
+++ b/spec/lib/gitlab_spec.rb
@@ -71,26 +71,30 @@ describe Gitlab do
end
describe '.com?' do
+ before do
+ Thread.current[:is_com] = nil
+ end
+
it 'is true when on GitLab.com' do
- stub_config_setting(url: 'https://gitlab.com')
+ allow(LightSettings).to receive(:host).and_return('gitlab.com')
expect(described_class.com?).to eq true
end
it 'is true when on staging' do
- stub_config_setting(url: 'https://staging.gitlab.com')
+ allow(LightSettings).to receive(:host).and_return('staging.gitlab.com')
expect(described_class.com?).to eq true
end
it 'is true when on other gitlab subdomain' do
- stub_config_setting(url: 'https://example.gitlab.com')
+ allow(LightSettings).to receive(:host).and_return('example.gitlab.com')
expect(described_class.com?).to eq true
end
it 'is false when not on GitLab.com' do
- stub_config_setting(url: 'http://example.com')
+ allow(LightSettings).to receive(:host).and_return('example.com')
expect(described_class.com?).to eq false
end