2016-04-12 14:39:08 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe Gitlab, lib: true do
|
|
|
|
describe '.com?' do
|
|
|
|
it 'is true when on GitLab.com' do
|
|
|
|
stub_config_setting(url: 'https://gitlab.com')
|
|
|
|
|
|
|
|
expect(described_class.com?).to eq true
|
|
|
|
end
|
|
|
|
|
2016-06-13 17:43:29 -04:00
|
|
|
it 'is true when on staging' do
|
|
|
|
stub_config_setting(url: 'https://staging.gitlab.com')
|
|
|
|
|
|
|
|
expect(described_class.com?).to eq true
|
|
|
|
end
|
|
|
|
|
2016-04-12 14:39:08 -04:00
|
|
|
it 'is false when not on GitLab.com' do
|
|
|
|
stub_config_setting(url: 'http://example.com')
|
|
|
|
|
|
|
|
expect(described_class.com?).to eq false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|