@@ -55,6 +55,9 class WatchersController < ApplicationController | |||||
55 | user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]] |
|
55 | user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]] | |
56 | @users = User.active.where(:id => user_ids).all |
|
56 | @users = User.active.where(:id => user_ids).all | |
57 | end |
|
57 | end | |
|
58 | if @users.blank? | |||
|
59 | render :nothing => true | |||
|
60 | end | |||
58 | end |
|
61 | end | |
59 |
|
62 | |||
60 | def destroy |
|
63 | def destroy |
@@ -237,6 +237,13 class WatchersControllerTest < ActionController::TestCase | |||||
237 | end |
|
237 | end | |
238 | end |
|
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 | def test_remove_watcher |
|
247 | def test_remove_watcher | |
241 | @request.session[:user_id] = 2 |
|
248 | @request.session[:user_id] = 2 | |
242 | assert_difference('Watcher.count', -1) do |
|
249 | assert_difference('Watcher.count', -1) do |
General Comments 0
You need to be logged in to leave comments.
Login now