diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 21:06:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 21:06:30 +0000 |
commit | 274ea604fcd43ecccfba04756a9475a3efa47de0 (patch) | |
tree | 33b203dedc5e5b980f945bdf01b9f16fe698417d /spec/controllers/admin/application_settings_controller_spec.rb | |
parent | 930ff68c1efc380cb7522aa9b3884842eecb2486 (diff) | |
download | gitlab-ce-274ea604fcd43ecccfba04756a9475a3efa47de0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/admin/application_settings_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/application_settings_controller_spec.rb | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb index 4eb0545eb6c..d62e0a97609 100644 --- a/spec/controllers/admin/application_settings_controller_spec.rb +++ b/spec/controllers/admin/application_settings_controller_spec.rb @@ -118,32 +118,7 @@ describe Admin::ApplicationSettingsController do end describe 'verify panel actions' do - shared_examples 'renders correct panels' do - it 'renders correct action on error' do - 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 } } - - expect(subject).to render_template(action) - end - - it 'redirects to same panel on success' do - 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 - - patch action, params: { application_setting: { unused_param: true } } - - expect(subject).to redirect_to(referer_path) - end - end - - (Admin::ApplicationSettingsController::VALID_SETTING_PANELS - %w(show templates geo)).each do |valid_action| + (Admin::ApplicationSettingsController::VALID_SETTING_PANELS - %w(templates geo)).each do |valid_action| it_behaves_like 'renders correct panels' do let(:action) { valid_action } end |