Use POST/DELETE to watch/unwatch an item.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11343 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-02-10 16:10:53 +00:00
parent 75129aaa1b
commit deffd81ada
4 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ class WatchersControllerTest < ActionController::TestCase
def test_unwatch
@request.session[:user_id] = 3
assert_difference('Watcher.count', -1) do
xhr :post, :unwatch, :object_type => 'issue', :object_id => '2'
xhr :delete, :unwatch, :object_type => 'issue', :object_id => '2'
assert_response :success
assert_include '$(".issue-2-watcher")', response.body
end
@@ -97,7 +97,7 @@ class WatchersControllerTest < ActionController::TestCase
Watcher.create!(:user_id => 3, :watchable => Issue.find(3))
assert_difference('Watcher.count', -2) do
xhr :post, :unwatch, :object_type => 'issue', :object_id => ['1', '3']
xhr :delete, :unwatch, :object_type => 'issue', :object_id => ['1', '3']
assert_response :success
assert_include '$(".issue-bulk-watcher")', response.body
end
+1 -1
View File
@@ -44,7 +44,7 @@ class RoutingWatchersTest < ActionController::IntegrationTest
{ :controller => 'watchers', :action => 'watch' }
)
assert_routing(
{ :method => 'post', :path => "/watchers/unwatch" },
{ :method => 'delete', :path => "/watchers/watch" },
{ :controller => 'watchers', :action => 'unwatch' }
)
assert_routing(