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