Commit b76ef40e authored by Airat Shigapov's avatar Airat Shigapov

Fix missing flash messages on service edit page

parent beb0b666
...@@ -40,6 +40,7 @@ v 8.12.0 (unreleased) ...@@ -40,6 +40,7 @@ v 8.12.0 (unreleased)
- Fix markdown help references (ClemMakesApps) - Fix markdown help references (ClemMakesApps)
- Add last commit time to repo view (ClemMakesApps) - Add last commit time to repo view (ClemMakesApps)
- Fix accessibility and visibility of project list dropdown button !6140 - Fix accessibility and visibility of project list dropdown button !6140
- Fix missing flash messages on service edit page (airatshigapov)
- Added project specific enable/disable setting for LFS !5997 - Added project specific enable/disable setting for LFS !5997
- Don't expose a user's token in the `/api/v3/user` API (!6047) - Don't expose a user's token in the `/api/v3/user` API (!6047)
- Remove redundant js-timeago-pending from user activity log (ClemMakesApps) - Remove redundant js-timeago-pending from user activity log (ClemMakesApps)
......
...@@ -20,9 +20,8 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -20,9 +20,8 @@ class Projects::ServicesController < Projects::ApplicationController
def update def update
if @service.update_attributes(service_params[:service]) if @service.update_attributes(service_params[:service])
redirect_to( redirect_to(
edit_namespace_project_service_path(@project.namespace, @project, edit_namespace_project_service_path(@project.namespace, @project, @service.to_param),
@service.to_param, notice: notice: 'Successfully updated.'
'Successfully updated.')
) )
else else
render 'edit' render 'edit'
......
...@@ -49,4 +49,20 @@ describe Projects::ServicesController do ...@@ -49,4 +49,20 @@ describe Projects::ServicesController do
let!(:referrer) { nil } let!(:referrer) { nil }
end end
end end
describe 'PUT #update' do
context 'on successful update' do
it 'sets the flash' do
expect(service).to receive(:to_param).and_return('hipchat')
put :update,
namespace_id: project.namespace.id,
project_id: project.id,
id: service.id,
service: { active: false }
expect(flash[:notice]).to eq 'Successfully updated.'
end
end
end
end end
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