diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-09 07:37:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-09 07:37:49 +0000 |
commit | 5adc1ddde9b4a353b2d2a499004c2025d6e8847a (patch) | |
tree | 157cb8f2a52a443b0b91beb2d43d70733e0e62cc /test/functional | |
parent | c8c694840d3c16450371141be609fd6b6e023667 (diff) | |
download | redmine-5adc1ddde9b4a353b2d2a499004c2025d6e8847a.tar.gz redmine-5adc1ddde9b4a353b2d2a499004c2025d6e8847a.zip |
Allow addition of watchers via bulk edit context menu (#5754).
git-svn-id: http://svn.redmine.org/redmine/trunk@15311 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/watchers_controller_test.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb index 3cbaf841a..d6220710b 100644 --- a/test/functional/watchers_controller_test.rb +++ b/test/functional/watchers_controller_test.rb @@ -133,6 +133,13 @@ class WatchersControllerTest < ActionController::TestCase assert_match /ajax-modal/, response.body end + def test_new_with_multiple_objects + @request.session[:user_id] = 2 + xhr :get, :new, :object_type => 'issue', :object_id => ['1', '2'] + assert_response :success + assert_match /ajax-modal/, response.body + end + def test_new_for_new_record_with_project_id @request.session[:user_id] = 2 xhr :get, :new, :project_id => 1 @@ -161,7 +168,7 @@ class WatchersControllerTest < ActionController::TestCase assert Issue.find(2).watched_by?(User.find(4)) end - def test_create_multiple + def test_create_with_mutiple_users @request.session[:user_id] = 2 assert_difference('Watcher.count', 2) do xhr :post, :create, :object_type => 'issue', :object_id => '2', @@ -174,6 +181,21 @@ class WatchersControllerTest < ActionController::TestCase assert Issue.find(2).watched_by?(User.find(7)) end + def test_create_with_mutiple_objects + @request.session[:user_id] = 2 + assert_difference('Watcher.count', 4) do + xhr :post, :create, :object_type => 'issue', :object_id => ['1', '2'], + :watcher => {:user_ids => ['4', '7']} + assert_response :success + assert_match /watchers/, response.body + assert_match /ajax-modal/, response.body + end + assert Issue.find(1).watched_by?(User.find(4)) + assert Issue.find(2).watched_by?(User.find(4)) + assert Issue.find(1).watched_by?(User.find(7)) + assert Issue.find(2).watched_by?(User.find(7)) + end + def test_autocomplete_on_watchable_creation @request.session[:user_id] = 2 xhr :get, :autocomplete_for_user, :q => 'mi', :project_id => 'ecookbook' |