diff options
author | Nick Thomas <nick@gitlab.com> | 2017-12-15 16:12:57 +0000 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-12-19 14:04:44 -0200 |
commit | 5a2ffac4fd6717f9ae00040df3ba21be874413b1 (patch) | |
tree | d557c9840d139d9018787daa870915aae9ab9337 | |
parent | f77b8bce47412c36f10b58ed8355fdf7c7d5fc3c (diff) | |
download | gitlab-ce-5a2ffac4fd6717f9ae00040df3ba21be874413b1.tar.gz |
Merge branch 'ignore-markdown-cache-when-stubbing-application-settings' into 'master'
Don't use Markdown cache for stubbed settings in specs
Closes #41130
See merge request gitlab-org/gitlab-ce!15954
(cherry picked from commit dc17e7d7a9a6a246cd8c69a7d06ff1dcfefd8384)
10885edf Don't use Markdown cache for stubbed settings in specs
-rw-r--r-- | spec/features/help_pages_spec.rb | 8 | ||||
-rw-r--r-- | spec/support/stub_configuration.rb | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index 93be3b066ee..ab896a310be 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -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_page_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 diff --git a/spec/support/stub_configuration.rb b/spec/support/stub_configuration.rb index b36cf3c544c..9f08c139322 100644 --- a/spec/support/stub_configuration.rb +++ b/spec/support/stub_configuration.rb @@ -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_not_protect_default_branch |