summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-10 16:10:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-10 16:10:53 +0000
commitdeffd81ada7107dafabf701d3df70f31ca3c743a (patch)
tree6debea122cf3888c2ce5e86b8bca65b918ea6c20 /test
parent75129aaa1b12547c1d60b6bb8e0ae2c36483fcfe (diff)
downloadredmine-deffd81ada7107dafabf701d3df70f31ca3c743a.tar.gz
redmine-deffd81ada7107dafabf701d3df70f31ca3c743a.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/functional/watchers_controller_test.rb4
-rw-r--r--test/integration/routing/watchers_test.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index 44bda3d99..7c80b0f4b 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -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
diff --git a/test/integration/routing/watchers_test.rb b/test/integration/routing/watchers_test.rb
index 3c203f4bc..39ef5a786 100644
--- a/test/integration/routing/watchers_test.rb
+++ b/test/integration/routing/watchers_test.rb
@@ -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(