Commit 67b18509 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'osw-avoid-noisy-warnings-on-test-env' into 'master'

Avoid noisy deprecation warnings on test env

See merge request gitlab-org/gitlab-ee!5473
parents 77bea357 dd6774f2
......@@ -107,7 +107,7 @@ module EE
end
def should_check_namespace_plan?
check_namespace_plan? && ::Gitlab.dev_env_or_com?
check_namespace_plan? && (Rails.env.test? || ::Gitlab.dev_env_or_com?)
end
def elasticsearch_indexing
......
......@@ -85,6 +85,14 @@ describe ApplicationSetting do
before do
stub_application_setting(check_namespace_plan: check_namespace_plan_column)
allow(::Gitlab).to receive(:dev_env_or_com?) { gl_com }
# This stub was added in order to force a fallback to Gitlab.dev_env_or_com?
# call testing.
# Gitlab.dev_env_or_com? responds to `false` on test envs
# and we want to make sure we're still testing
# should_check_namespace_plan? method through the test-suite (see
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18461#note_69322821).
allow(Rails).to receive_message_chain(:env, :test?).and_return(false)
end
subject { setting.should_check_namespace_plan? }
......
......@@ -35,6 +35,6 @@ module Gitlab
end
def self.dev_env_or_com?
Rails.env.test? || Rails.env.development? || org? || com?
Rails.env.development? || org? || com?
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