summaryrefslogtreecommitdiffstats
path: root/test/functional/watchers_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-25 12:11:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-25 12:11:53 +0000
commit97b4e754787dea8d56feec95a433648839d70ff0 (patch)
tree7a00daa88cb5f5de965818a7b72b86661c6303c8 /test/functional/watchers_controller_test.rb
parent6fedbf60d5a9bb2747b1e250ffc9f5f4947676f6 (diff)
downloadredmine-97b4e754787dea8d56feec95a433648839d70ff0.tar.gz
redmine-97b4e754787dea8d56feec95a433648839d70ff0.zip
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
Diffstat (limited to 'test/functional/watchers_controller_test.rb')
-rw-r--r--test/functional/watchers_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index 3b48767b9..d36f7831c 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -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