##// END OF EJS Templates
Fixed: Error generated on 'search for watchers to add' after clicking add without selected users (#14298)....
Jean-Philippe Lang -
r12710:b29c48717d8d
parent child
Show More
@@ -55,6 +55,9 class WatchersController < ApplicationController
55 55 user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
56 56 @users = User.active.where(:id => user_ids).all
57 57 end
58 if @users.blank?
59 render :nothing => true
60 end
58 61 end
59 62
60 63 def destroy
@@ -237,6 +237,13 class WatchersControllerTest < ActionController::TestCase
237 237 end
238 238 end
239 239
240 def test_append_without_user_should_render_nothing
241 @request.session[:user_id] = 2
242 xhr :post, :append, :project_id => 'ecookbook'
243 assert_response :success
244 assert response.body.blank?
245 end
246
240 247 def test_remove_watcher
241 248 @request.session[:user_id] = 2
242 249 assert_difference('Watcher.count', -1) do
General Comments 0
You need to be logged in to leave comments. Login now