summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordstull <dstull@gitlab.com>2019-08-27 10:12:08 -0400
committerdstull <dstull@gitlab.com>2019-08-27 10:12:08 -0400
commitb610d25872999666c26441d8fa828064eb0225a6 (patch)
tree83a24d4b34303f07f28bb47cdbc133a8d5e2ed31
parentc49f75a838dbd904e09e8c0af62424c82ac1dc62 (diff)
downloadgitlab-ce-ce-refactor-dev-org-com-helper.tar.gz
Refactor tests as per feedbackce-refactor-dev-org-com-helper
-rw-r--r--spec/lib/gitlab_spec.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb
index 2ee3785138e..5fcf56b2378 100644
--- a/spec/lib/gitlab_spec.rb
+++ b/spec/lib/gitlab_spec.rb
@@ -98,30 +98,26 @@ describe Gitlab do
describe '.dev_env_org_or_com?' do
it 'is true when on .com' do
- allow(described_class).to receive(:com?).and_return(true)
- allow(described_class).to receive(:org?).and_return(false)
+ 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(:org?).and_return(true)
- allow(described_class).to receive(:com?).and_return(false)
+ 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(:org?).and_return(false)
- allow(described_class).to receive(:com?).and_return(false)
+ 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(:org?).and_return(false)
- allow(described_class).to receive(:com?).and_return(false)
+ allow(described_class).to receive_messages(com?: false, org?: false)
expect(described_class.dev_env_org_or_com?).to eq false
end