Commit 2e13f6c3 authored by Robert Speicher's avatar Robert Speicher

Add `Gitlab.com?` method

To be used as a feature flag for GitLab.com-only features, such as
welcome emails.

We will be careful to only use this to disable features or functionality
that do not make sense for any installations that aren't GitLab.com. We
will not use this to restrict features from other installations or keep
them "exclusive" to GitLab.com.
parent 2c9894d4
require 'gitlab/git'
module Gitlab
def self.com?
Gitlab.config.gitlab.url == 'https://gitlab.com'
end
end
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
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment