Skip to content
Snippets Groups Projects
Commit 2e13f6c3 authored by Robert Speicher's avatar Robert Speicher
Browse files

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
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment