Commit dc856eef authored by Rémy Coutable's avatar Rémy Coutable

Introduce stub_ee_application_setting

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b42994d6
require Rails.root.join('spec', 'support', 'stub_configuration')
require_dependency Rails.root.join('spec', 'support', 'stub_configuration')
class Spinach::Features::GlobalSearch < Spinach::FeatureSteps
include SharedAuthentication
......
module EE
module StubConfiguration
def stub_ee_application_setting(messages)
add_predicates(messages)
# Stubbing both of these because we're not yet consistent with how we access
# current application settings
allow_any_instance_of(EE::ApplicationSetting).to receive_messages(to_settings(messages))
allow(::Gitlab::CurrentSettings.current_application_settings)
.to receive_messages(to_settings(messages))
# Ensure that we don't use the Markdown cache when stubbing these values
allow_any_instance_of(EE::ApplicationSetting).to receive(:cached_html_up_to_date?).and_return(false)
end
end
end
......@@ -11,7 +11,7 @@ describe 'GlobalSearch' do
let(:guest) { create :user }
before do
stub_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
Gitlab::Elastic::Helper.create_empty_index
project.add_developer(member)
......@@ -21,7 +21,7 @@ describe 'GlobalSearch' do
after do
Gitlab::Elastic::Helper.delete_index
stub_application_setting(elasticsearch_search: false, elasticsearch_indexing: false)
stub_ee_application_setting(elasticsearch_search: false, elasticsearch_indexing: false)
end
context "Respect feature visibility levels" do
......
require_dependency Rails.root.join('spec', 'ee', 'support', 'stub_configuration')
module StubConfiguration
prepend EE::StubConfiguration
def stub_application_setting(messages)
add_predicates(messages)
......
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