@@ -131,7 +131,8 class WatchersControllerTest < ActionController::TestCase | |||||
131 | def test_create |
|
131 | def test_create | |
132 | @request.session[:user_id] = 2 |
|
132 | @request.session[:user_id] = 2 | |
133 | assert_difference('Watcher.count') do |
|
133 | assert_difference('Watcher.count') do | |
134 |
xhr :post, :create, :object_type => 'issue', :object_id => '2', |
|
134 | xhr :post, :create, :object_type => 'issue', :object_id => '2', | |
|
135 | :watcher => {:user_id => '4'} | |||
135 | assert_response :success |
|
136 | assert_response :success | |
136 | assert_match /watchers/, response.body |
|
137 | assert_match /watchers/, response.body | |
137 | assert_match /ajax-modal/, response.body |
|
138 | assert_match /ajax-modal/, response.body | |
@@ -142,7 +143,8 class WatchersControllerTest < ActionController::TestCase | |||||
142 | def test_create_multiple |
|
143 | def test_create_multiple | |
143 | @request.session[:user_id] = 2 |
|
144 | @request.session[:user_id] = 2 | |
144 | assert_difference('Watcher.count', 2) do |
|
145 | assert_difference('Watcher.count', 2) do | |
145 |
xhr :post, :create, :object_type => 'issue', :object_id => '2', |
|
146 | xhr :post, :create, :object_type => 'issue', :object_id => '2', | |
|
147 | :watcher => {:user_ids => ['4', '7']} | |||
146 | assert_response :success |
|
148 | assert_response :success | |
147 | assert_match /watchers/, response.body |
|
149 | assert_match /watchers/, response.body | |
148 | assert_match /ajax-modal/, response.body |
|
150 | assert_match /ajax-modal/, response.body | |
@@ -164,13 +166,13 class WatchersControllerTest < ActionController::TestCase | |||||
164 |
|
166 | |||
165 | def test_autocomplete_on_watchable_update |
|
167 | def test_autocomplete_on_watchable_update | |
166 | @request.session[:user_id] = 2 |
|
168 | @request.session[:user_id] = 2 | |
167 |
xhr :get, :autocomplete_for_user, :q => 'mi', :object_id => '2' |
|
169 | xhr :get, :autocomplete_for_user, :q => 'mi', :object_id => '2', | |
|
170 | :object_type => 'issue', :project_id => 'ecookbook' | |||
168 | assert_response :success |
|
171 | assert_response :success | |
169 | assert_select 'input', :count => 3 |
|
172 | assert_select 'input', :count => 3 | |
170 | assert_select 'input[name=?][value=2]', 'watcher[user_ids][]' |
|
173 | assert_select 'input[name=?][value=2]', 'watcher[user_ids][]' | |
171 | assert_select 'input[name=?][value=8]', 'watcher[user_ids][]' |
|
174 | assert_select 'input[name=?][value=8]', 'watcher[user_ids][]' | |
172 | assert_select 'input[name=?][value=9]', 'watcher[user_ids][]' |
|
175 | assert_select 'input[name=?][value=9]', 'watcher[user_ids][]' | |
173 |
|
||||
174 | end |
|
176 | end | |
175 |
|
177 | |||
176 | def test_append |
|
178 | def test_append |
General Comments 0
You need to be logged in to leave comments.
Login now