Merged r12985 ().

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13019 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-03-29 14:34:28 +00:00
parent d10f17f216
commit 58786e8d80
2 changed files with 10 additions and 0 deletions

View File

@ -55,6 +55,9 @@ class WatchersController < ApplicationController
user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]] user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
@users = User.active.where(:id => user_ids).all @users = User.active.where(:id => user_ids).all
end end
if @users.blank?
render :nothing => true
end
end end
def destroy def destroy

View File

@ -237,6 +237,13 @@ class WatchersControllerTest < ActionController::TestCase
end end
end end
def test_append_without_user_should_render_nothing
@request.session[:user_id] = 2
xhr :post, :append, :project_id => 'ecookbook'
assert_response :success
assert response.body.blank?
end
def test_remove_watcher def test_remove_watcher
@request.session[:user_id] = 2 @request.session[:user_id] = 2
assert_difference('Watcher.count', -1) do assert_difference('Watcher.count', -1) do