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