summaryrefslogtreecommitdiffstats
path: root/test/functional/watchers_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/watchers_controller_test.rb')
-rw-r--r--test/functional/watchers_controller_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index bfd93fe0d..03b1a977b 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -68,6 +68,13 @@ class WatchersControllerTest < ActionController::TestCase
assert_select_rjs :replace_html, 'ajax-modal'
end
+ def test_new_for_new_record
+ @request.session[:user_id] = 2
+ xhr :get, :new, :project_id => 1
+ assert_response :success
+ assert_select_rjs :replace_html, 'ajax-modal'
+ end
+
def test_create
@request.session[:user_id] = 2
assert_difference('Watcher.count') do
@@ -91,6 +98,18 @@ class WatchersControllerTest < ActionController::TestCase
assert Issue.find(2).watched_by?(User.find(7))
end
+ def test_append
+ @request.session[:user_id] = 2
+ assert_no_difference 'Watcher.count' do
+ xhr :post, :append, :watcher => {:user_ids => ['4', '7']}
+ assert_response :success
+ assert_select_rjs :insert_html, 'watchers_inputs' do
+ assert_select 'input[name=?][value=4]', 'issue[watcher_user_ids][]'
+ assert_select 'input[name=?][value=7]', 'issue[watcher_user_ids][]'
+ end
+ end
+ end
+
def test_remove_watcher
@request.session[:user_id] = 2
assert_difference('Watcher.count', -1) do