ソースを参照

Fixed: Error generated on 'search for watchers to add' after clicking add without selected users (#14298).

git-svn-id: http://svn.redmine.org/redmine/trunk@12985 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.6.0
Jean-Philippe Lang 10年前
コミット
b29c48717d
2個のファイルの変更10行の追加0行の削除
  1. 3
    0
      app/controllers/watchers_controller.rb
  2. 7
    0
      test/functional/watchers_controller_test.rb

+ 3
- 0
app/controllers/watchers_controller.rb ファイルの表示

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

def destroy

+ 7
- 0
test/functional/watchers_controller_test.rb ファイルの表示

@@ -237,6 +237,13 @@ class WatchersControllerTest < ActionController::TestCase
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
@request.session[:user_id] = 2
assert_difference('Watcher.count', -1) do

読み込み中…
キャンセル
保存