@@ -24,7 +24,9 class UsersController; def rescue_action(e) raise e end; end | |||
|
24 | 24 | class UsersControllerTest < ActionController::TestCase |
|
25 | 25 | include Redmine::I18n |
|
26 | 26 | |
|
27 |
fixtures :users, :projects, :members, :member_roles, :roles, |
|
|
27 | fixtures :users, :projects, :members, :member_roles, :roles, | |
|
28 | :custom_fields, :custom_values, :groups_users, | |
|
29 | :auth_sources | |
|
28 | 30 | |
|
29 | 31 | def setup |
|
30 | 32 | @controller = UsersController.new |
@@ -156,7 +158,6 class UsersControllerTest < ActionController::TestCase | |||
|
156 | 158 | |
|
157 | 159 | def test_new |
|
158 | 160 | get :new |
|
159 | ||
|
160 | 161 | assert_response :success |
|
161 | 162 | assert_template :new |
|
162 | 163 | assert assigns(:user) |
@@ -228,14 +229,12 class UsersControllerTest < ActionController::TestCase | |||
|
228 | 229 | assert_no_difference 'User.count' do |
|
229 | 230 | post :create, :user => {} |
|
230 | 231 | end |
|
231 | ||
|
232 | 232 | assert_response :success |
|
233 | 233 | assert_template 'new' |
|
234 | 234 | end |
|
235 | 235 | |
|
236 | 236 | def test_edit |
|
237 | 237 | get :edit, :id => 2 |
|
238 | ||
|
239 | 238 | assert_response :success |
|
240 | 239 | assert_template 'edit' |
|
241 | 240 | assert_equal User.find(2), assigns(:user) |
@@ -243,8 +242,9 class UsersControllerTest < ActionController::TestCase | |||
|
243 | 242 | |
|
244 | 243 | def test_update |
|
245 | 244 | ActionMailer::Base.deliveries.clear |
|
246 | put :update, :id => 2, :user => {:firstname => 'Changed', :mail_notification => 'only_assigned'}, :pref => {:hide_mail => '1', :comments_sorting => 'desc'} | |
|
247 | ||
|
245 | put :update, :id => 2, | |
|
246 | :user => {:firstname => 'Changed', :mail_notification => 'only_assigned'}, | |
|
247 | :pref => {:hide_mail => '1', :comments_sorting => 'desc'} | |
|
248 | 248 | user = User.find(2) |
|
249 | 249 | assert_equal 'Changed', user.firstname |
|
250 | 250 | assert_equal 'only_assigned', user.mail_notification |
@@ -257,14 +257,12 class UsersControllerTest < ActionController::TestCase | |||
|
257 | 257 | assert_no_difference 'User.count' do |
|
258 | 258 | put :update, :id => 2, :user => {:firstname => ''} |
|
259 | 259 | end |
|
260 | ||
|
261 | 260 | assert_response :success |
|
262 | 261 | assert_template 'edit' |
|
263 | 262 | end |
|
264 | 263 | |
|
265 | 264 | def test_update_with_group_ids_should_assign_groups |
|
266 | 265 | put :update, :id => 2, :user => {:group_ids => ['10']} |
|
267 | ||
|
268 | 266 | user = User.find(2) |
|
269 | 267 | assert_equal [10], user.group_ids |
|
270 | 268 | end |
General Comments 0
You need to be logged in to leave comments.
Login now