Merge branch 'ce-refactor-dev-org-com-helper' into 'master'
Rename dev, org, com helper See merge request gitlab-org/gitlab-ce!32115
This commit is contained in:
commit
0b563f8782
|
@ -55,7 +55,7 @@ module Gitlab
|
|||
SUBDOMAIN_REGEX === Gitlab.config.gitlab.url
|
||||
end
|
||||
|
||||
def self.dev_env_or_com?
|
||||
def self.dev_env_org_or_com?
|
||||
Rails.env.development? || org? || com?
|
||||
end
|
||||
|
||||
|
|
|
@ -98,6 +98,33 @@ describe Gitlab do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.dev_env_org_or_com?' do
|
||||
it 'is true when on .com' do
|
||||
allow(described_class).to receive_messages(com?: true, org?: false)
|
||||
|
||||
expect(described_class.dev_env_org_or_com?).to eq true
|
||||
end
|
||||
|
||||
it 'is true when org' do
|
||||
allow(described_class).to receive_messages(com?: false, org?: true)
|
||||
|
||||
expect(described_class.dev_env_org_or_com?).to eq true
|
||||
end
|
||||
|
||||
it 'is true when dev env' do
|
||||
allow(described_class).to receive_messages(com?: false, org?: false)
|
||||
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
|
||||
|
||||
expect(described_class.dev_env_org_or_com?).to eq true
|
||||
end
|
||||
|
||||
it 'is false when not dev, org or com' do
|
||||
allow(described_class).to receive_messages(com?: false, org?: false)
|
||||
|
||||
expect(described_class.dev_env_org_or_com?).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
describe '.ee?' do
|
||||
before do
|
||||
described_class.instance_variable_set(:@is_ee, nil)
|
||||
|
|
Loading…
Reference in New Issue