Fix missing flash messages on service edit page

This commit is contained in:
Airat Shigapov 2016-09-04 16:33:14 +03:00
parent beb0b666dc
commit b76ef40e36
No known key found for this signature in database
GPG Key ID: 95B04300D2844C47
3 changed files with 19 additions and 3 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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