Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-06-20 20:15:09 +0300
committerMayra Cabrera <mcabrera@gitlab.com>2019-06-20 20:15:09 +0300
commit4e98c0240f2d7df1c05b289b19dfb42e68307cc0 (patch)
treeb57b6f02c9e60ff000f9ad9a49ed6fffce37ba72
parentd98bae878f95e27f235d6c674eab839fe5de005a (diff)
parent23b35e0592b55d91e4d77ae9c758750ea13ab892 (diff)
Merge branch 'bvl-fix-application-setting-spec-ce' into 'master'
Use next_instance_of instead of any_instance_of See merge request gitlab-org/gitlab-ce!29905
-rw-r--r--spec/controllers/admin/application_settings_controller_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb
index c7f814c58c0..5ad5f9cdeea 100644
--- a/spec/controllers/admin/application_settings_controller_spec.rb
+++ b/spec/controllers/admin/application_settings_controller_spec.rb
@@ -120,7 +120,9 @@ describe Admin::ApplicationSettingsController do
describe 'verify panel actions' do
shared_examples 'renders correct panels' do
it 'renders correct action on error' do
- allow_any_instance_of(ApplicationSettings::UpdateService).to receive(:execute).and_return(false)
+ expect_next_instance_of(ApplicationSettings::UpdateService) do |service|
+ allow(service).to receive(:execute).and_return(false)
+ end
patch action, params: { application_setting: { unused_param: true } }
@@ -128,7 +130,10 @@ describe Admin::ApplicationSettingsController do
end
it 'redirects to same panel on success' do
- allow_any_instance_of(ApplicationSettings::UpdateService).to receive(:execute).and_return(true)
+ expect_next_instance_of(ApplicationSettings::UpdateService) do |service|
+ allow(service).to receive(:execute).and_return(true)
+ end
+
referer_path = public_send("#{action}_admin_application_settings_path")
request.env["HTTP_REFERER"] = referer_path