summaryrefslogtreecommitdiffstats
path: root/test/functional/watchers_controller_test.rb
diff options
context:
space:
mode:
authorEtienne Massip <etienne.massip@gmail.com>2012-04-05 18:10:54 +0000
committerEtienne Massip <etienne.massip@gmail.com>2012-04-05 18:10:54 +0000
commitd36d64f6648e96c40acb3639a5f33371b20b2e91 (patch)
tree428bc961c7a27b2449804fcf94734d212693cb26 /test/functional/watchers_controller_test.rb
parentddce7ef142bb7e18e0f5e6b50611ec5203e56a19 (diff)
downloadredmine-d36d64f6648e96c40acb3639a5f33371b20b2e91.tar.gz
redmine-d36d64f6648e96c40acb3639a5f33371b20b2e91.zip
Fixed Internal Error in watchers XHR search (#10600).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9323 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/watchers_controller_test.rb')
-rw-r--r--test/functional/watchers_controller_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index 03b1a977b..8781db797 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -98,6 +98,26 @@ class WatchersControllerTest < ActionController::TestCase
assert Issue.find(2).watched_by?(User.find(7))
end
+ def test_autocomplete_on_watchable_creation
+ xhr :get, :autocomplete_for_user, :q => 'mi'
+ assert_response :success
+ assert_select 'input', :count => 4
+ assert_select 'input[name=?][value=1]', 'watcher[user_ids][]'
+ assert_select 'input[name=?][value=2]', 'watcher[user_ids][]'
+ assert_select 'input[name=?][value=8]', 'watcher[user_ids][]'
+ assert_select 'input[name=?][value=9]', 'watcher[user_ids][]'
+ end
+
+ def test_autocomplete_on_watchable_update
+ xhr :get, :autocomplete_for_user, :q => 'mi', :object_id => '2' , :object_type => 'issue'
+ assert_response :success
+ assert_select 'input', :count => 3
+ assert_select 'input[name=?][value=2]', 'watcher[user_ids][]'
+ assert_select 'input[name=?][value=8]', 'watcher[user_ids][]'
+ assert_select 'input[name=?][value=9]', 'watcher[user_ids][]'
+
+ end
+
def test_append
@request.session[:user_id] = 2
assert_no_difference 'Watcher.count' do