Commit 65924174 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'ee-ignore-markdown-cache-when-stubbing-application-settings' into 'master'

Don't use Markdown cache for stubbed settings in specs

See merge request gitlab-org/gitlab-ee!3793
parents 6d0f5c1c e8acc430
%div
- if current_application_settings.help_text.present?
= markdown(current_application_settings.help_text)
- if current_application_settings.help_page_text.present?
= markdown(current_application_settings.help_page_text)
%hr
- unless current_application_settings.help_page_hide_commercial_content?
......
......@@ -37,7 +37,7 @@ describe 'Help Pages' do
context 'in a production environment with version check enabled', :js do
before do
allow(Rails.env).to receive(:production?) { true }
allow_any_instance_of(ApplicationSetting).to receive(:version_check_enabled) { true }
stub_application_setting(version_check_enabled: true)
allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' }
sign_in(create(:user))
......@@ -56,9 +56,9 @@ describe 'Help Pages' do
describe 'when help page is customized' do
before do
allow_any_instance_of(ApplicationSetting).to receive(:help_page_hide_commercial_content?) { true }
allow_any_instance_of(ApplicationSetting).to receive(:help_text) { "My Custom Text" }
allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" }
stub_application_setting(help_page_hide_commercial_content: true,
help_page_text: 'My Custom Text',
help_page_support_url: 'http://example.com/help')
sign_in(create(:user))
visit help_path
......
......@@ -7,6 +7,9 @@ module StubConfiguration
allow_any_instance_of(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(ApplicationSetting).to receive(:cached_html_up_to_date?).and_return(false)
end
def stub_application_setting_on_object(object, 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