summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/watchers_controller_test.rb2
-rw-r--r--test/integration/routing/watchers_test.rb2
-rw-r--r--test/ui/issues_test.rb13
3 files changed, 15 insertions, 2 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index 7c80b0f4b..bc8b58b0c 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -186,7 +186,7 @@ class WatchersControllerTest < ActionController::TestCase
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'
+ xhr :delete, :destroy, :object_type => 'issue', :object_id => '2', :user_id => '3'
assert_response :success
assert_match /watchers/, response.body
end
diff --git a/test/integration/routing/watchers_test.rb b/test/integration/routing/watchers_test.rb
index 39ef5a786..eb6a62163 100644
--- a/test/integration/routing/watchers_test.rb
+++ b/test/integration/routing/watchers_test.rb
@@ -32,7 +32,7 @@ class RoutingWatchersTest < ActionController::IntegrationTest
{ :controller => 'watchers', :action => 'create' }
)
assert_routing(
- { :method => 'post', :path => "/watchers/destroy" },
+ { :method => 'delete', :path => "/watchers" },
{ :controller => 'watchers', :action => 'destroy' }
)
assert_routing(
diff --git a/test/ui/issues_test.rb b/test/ui/issues_test.rb
index 3a628c9b6..66a6197bb 100644
--- a/test/ui/issues_test.rb
+++ b/test/ui/issues_test.rb
@@ -172,6 +172,19 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
assert_equal 'CF value', issue.custom_field_value(field)
end
+ def test_remove_issue_watcher_from_sidebar
+ user = User.find(3)
+ Watcher.create!(:watchable => Issue.find(1), :user => user)
+
+ log_user('jsmith', 'jsmith')
+ visit '/issues/1'
+ assert page.first('#sidebar').has_content?(user.name)
+ assert_difference 'Watcher.count', -1 do
+ page.first('ul.watchers .user-3 a.delete').click
+ end
+ assert page.first('#sidebar').has_no_content?(user.name)
+ end
+
def test_watch_issue_via_context_menu
log_user('jsmith', 'jsmith')
visit '/issues'