Fix missing flash messages on service edit page
This commit is contained in:
parent
beb0b666dc
commit
b76ef40e36
3 changed files with 19 additions and 3 deletions
|
@ -40,6 +40,7 @@ v 8.12.0 (unreleased)
|
|||
- Fix markdown help references (ClemMakesApps)
|
||||
- Add last commit time to repo view (ClemMakesApps)
|
||||
- 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
|
||||
- Don't expose a user's token in the `/api/v3/user` API (!6047)
|
||||
- Remove redundant js-timeago-pending from user activity log (ClemMakesApps)
|
||||
|
|
|
@ -20,9 +20,8 @@ class Projects::ServicesController < Projects::ApplicationController
|
|||
def update
|
||||
if @service.update_attributes(service_params[:service])
|
||||
redirect_to(
|
||||
edit_namespace_project_service_path(@project.namespace, @project,
|
||||
@service.to_param, notice:
|
||||
'Successfully updated.')
|
||||
edit_namespace_project_service_path(@project.namespace, @project, @service.to_param),
|
||||
notice: 'Successfully updated.'
|
||||
)
|
||||
else
|
||||
render 'edit'
|
||||
|
|
|
@ -49,4 +49,20 @@ describe Projects::ServicesController do
|
|||
let!(:referrer) { nil }
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue