From 2e13f6c326b920f1b78ca592dc1b938b62d5eef3 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 12 Apr 2016 14:39:08 -0400 Subject: 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. --- spec/lib/gitlab_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/lib/gitlab_spec.rb (limited to 'spec/lib/gitlab_spec.rb') diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb new file mode 100644 index 00000000000..c59dfea5c55 --- /dev/null +++ b/spec/lib/gitlab_spec.rb @@ -0,0 +1,17 @@ +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 -- cgit v1.2.3