Add a permission to remove issue watchers (#2450).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2977 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-10-25 12:11:53 +00:00
parent 6fedbf60d5
commit 97b4e75478
5 changed files with 41 additions and 2 deletions
@@ -67,4 +67,14 @@ class WatchersControllerTest < ActionController::TestCase
end
assert Issue.find(2).watched_by?(User.find(4))
end
def test_remove_watcher
@request.session[:user_id] = 2
assert_difference('Watcher.count', -1) do
xhr :post, :destroy, :object_type => 'issue', :object_id => '2', :user_id => '3'
assert_response :success
assert_select_rjs :replace_html, 'watchers'
end
assert !Issue.find(2).watched_by?(User.find(3))
end
end