Commit 7c6fe4da authored by jplang's avatar jplang

Pass parameters with :params in controller tests.

git-svn-id: https://svn.redmine.org/redmine/trunk@15664 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f66019a9
...@@ -42,7 +42,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -42,7 +42,7 @@ class UsersControllerTest < Redmine::ControllerTest
end end
def test_index_with_status_filter def test_index_with_status_filter
get :index, :status => 3 get :index, :params => {:status => 3}
assert_response :success assert_response :success
assert_template 'index' assert_template 'index'
assert_not_nil assigns(:users) assert_not_nil assigns(:users)
...@@ -50,7 +50,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -50,7 +50,7 @@ class UsersControllerTest < Redmine::ControllerTest
end end
def test_index_with_name_filter def test_index_with_name_filter
get :index, :name => 'john' get :index, :params => {:name => 'john'}
assert_response :success assert_response :success
assert_template 'index' assert_template 'index'
users = assigns(:users) users = assigns(:users)
...@@ -60,7 +60,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -60,7 +60,7 @@ class UsersControllerTest < Redmine::ControllerTest
end end
def test_index_with_group_filter def test_index_with_group_filter
get :index, :group_id => '10' get :index, :params => {:group_id => '10'}
assert_response :success assert_response :success
assert_template 'index' assert_template 'index'
users = assigns(:users) users = assigns(:users)
...@@ -73,7 +73,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -73,7 +73,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_show def test_show
@request.session[:user_id] = nil @request.session[:user_id] = nil
get :show, :id => 2 get :show, :params => {:id => 2}
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:user) assert_not_nil assigns(:user)
...@@ -84,7 +84,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -84,7 +84,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_show_should_not_display_hidden_custom_fields def test_show_should_not_display_hidden_custom_fields
@request.session[:user_id] = nil @request.session[:user_id] = nil
UserCustomField.find_by_name('Phone number').update_attribute :visible, false UserCustomField.find_by_name('Phone number').update_attribute :visible, false
get :show, :id => 2 get :show, :params => {:id => 2}
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:user) assert_not_nil assigns(:user)
...@@ -99,19 +99,19 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -99,19 +99,19 @@ class UsersControllerTest < Redmine::ControllerTest
custom_field = CustomField.create!(:name => 'Testing', :field_format => 'text') custom_field = CustomField.create!(:name => 'Testing', :field_format => 'text')
custom_value = user.custom_values.build(:custom_field => custom_field).save! custom_value = user.custom_values.build(:custom_field => custom_field).save!
get :show, :id => 2 get :show, :params => {:id => 2}
assert_response :success assert_response :success
end end
def test_show_inactive def test_show_inactive
@request.session[:user_id] = nil @request.session[:user_id] = nil
get :show, :id => 5 get :show, :params => {:id => 5}
assert_response 404 assert_response 404
end end
def test_show_inactive_by_admin def test_show_inactive_by_admin
@request.session[:user_id] = 1 @request.session[:user_id] = 1
get :show, :id => 5 get :show, :params => {:id => 5}
assert_response 200 assert_response 200
assert_not_nil assigns(:user) assert_not_nil assigns(:user)
end end
...@@ -121,13 +121,13 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -121,13 +121,13 @@ class UsersControllerTest < Redmine::ControllerTest
user = User.generate! user = User.generate!
@request.session[:user_id] = nil @request.session[:user_id] = nil
get :show, :id => user.id get :show, :params => {:id => user.id}
assert_response 404 assert_response 404
end end
def test_show_displays_memberships_based_on_project_visibility def test_show_displays_memberships_based_on_project_visibility
@request.session[:user_id] = 1 @request.session[:user_id] = 1
get :show, :id => 2 get :show, :params => {:id => 2}
assert_response :success assert_response :success
memberships = assigns(:memberships) memberships = assigns(:memberships)
assert_not_nil memberships assert_not_nil memberships
...@@ -137,13 +137,13 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -137,13 +137,13 @@ class UsersControllerTest < Redmine::ControllerTest
def test_show_current_should_require_authentication def test_show_current_should_require_authentication
@request.session[:user_id] = nil @request.session[:user_id] = nil
get :show, :id => 'current' get :show, :params => {:id => 'current'}
assert_response 302 assert_response 302
end end
def test_show_current def test_show_current
@request.session[:user_id] = 2 @request.session[:user_id] = 2
get :show, :id => 'current' get :show, :params => {:id => 'current'}
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_equal User.find(2), assigns(:user) assert_equal User.find(2), assigns(:user)
...@@ -161,7 +161,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -161,7 +161,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_difference 'User.count' do assert_difference 'User.count' do
assert_difference 'ActionMailer::Base.deliveries.size' do assert_difference 'ActionMailer::Base.deliveries.size' do
post :create, post :create, :params => {
:user => { :user => {
:firstname => 'John', :firstname => 'John',
:lastname => 'Doe', :lastname => 'Doe',
...@@ -172,6 +172,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -172,6 +172,7 @@ class UsersControllerTest < Redmine::ControllerTest
:mail_notification => 'none' :mail_notification => 'none'
}, },
:send_information => '1' :send_information => '1'
}
end end
end end
...@@ -193,7 +194,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -193,7 +194,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_with_preferences def test_create_with_preferences
assert_difference 'User.count' do assert_difference 'User.count' do
post :create, post :create, :params => {
:user => { :user => {
:firstname => 'John', :firstname => 'John',
:lastname => 'Doe', :lastname => 'Doe',
...@@ -209,6 +210,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -209,6 +210,7 @@ class UsersControllerTest < Redmine::ControllerTest
'comments_sorting' => 'desc', 'comments_sorting' => 'desc',
'warn_on_leaving_unsaved' => '0' 'warn_on_leaving_unsaved' => '0'
} }
}
end end
user = User.order('id DESC').first user = User.order('id DESC').first
assert_equal 'jdoe', user.login assert_equal 'jdoe', user.login
...@@ -220,16 +222,19 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -220,16 +222,19 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_with_generate_password_should_email_the_password def test_create_with_generate_password_should_email_the_password
assert_difference 'User.count' do assert_difference 'User.count' do
post :create, :user => { post :create, :params => {
:login => 'randompass', :user => {
:firstname => 'Random', :login => 'randompass',
:lastname => 'Pass', :firstname => 'Random',
:mail => 'randompass@example.net', :lastname => 'Pass',
:language => 'en', :mail => 'randompass@example.net',
:generate_password => '1', :language => 'en',
:password => '', :generate_password => '1',
:password_confirmation => '' :password => '',
}, :send_information => 1 :password_confirmation => ''
},
:send_information => 1
}
end end
user = User.order('id DESC').first user = User.order('id DESC').first
assert_equal 'randompass', user.login assert_equal 'randompass', user.login
...@@ -243,19 +248,22 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -243,19 +248,22 @@ class UsersControllerTest < Redmine::ControllerTest
end end
def test_create_and_continue def test_create_and_continue
post :create, :user => { post :create, :params => {
:user => {
:login => 'randompass', :login => 'randompass',
:firstname => 'Random', :firstname => 'Random',
:lastname => 'Pass', :lastname => 'Pass',
:mail => 'randompass@example.net', :mail => 'randompass@example.net',
:generate_password => '1' :generate_password => '1'
}, :continue => '1' },
:continue => '1'
}
assert_redirected_to '/users/new?user%5Bgenerate_password%5D=1' assert_redirected_to '/users/new?user%5Bgenerate_password%5D=1'
end end
def test_create_with_failure def test_create_with_failure
assert_no_difference 'User.count' do assert_no_difference 'User.count' do
post :create, :user => {} post :create, :params => {:user => {}}
end end
assert_response :success assert_response :success
assert_template 'new' assert_template 'new'
...@@ -263,7 +271,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -263,7 +271,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_with_failure_sould_preserve_preference def test_create_with_failure_sould_preserve_preference
assert_no_difference 'User.count' do assert_no_difference 'User.count' do
post :create, post :create, :params => {
:user => {}, :user => {},
:pref => { :pref => {
'no_self_notified' => '1', 'no_self_notified' => '1',
...@@ -272,6 +280,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -272,6 +280,7 @@ class UsersControllerTest < Redmine::ControllerTest
'comments_sorting' => 'desc', 'comments_sorting' => 'desc',
'warn_on_leaving_unsaved' => '0' 'warn_on_leaving_unsaved' => '0'
} }
}
end end
assert_response :success assert_response :success
assert_template 'new' assert_template 'new'
...@@ -282,7 +291,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -282,7 +291,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_admin_should_send_security_notification def test_create_admin_should_send_security_notification
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
post :create, post :create, :params => {
:user => { :user => {
:firstname => 'Edgar', :firstname => 'Edgar',
:lastname => 'Schmoe', :lastname => 'Schmoe',
...@@ -292,6 +301,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -292,6 +301,7 @@ class UsersControllerTest < Redmine::ControllerTest
:mail => 'eschmoe@example.foo', :mail => 'eschmoe@example.foo',
:admin => '1' :admin => '1'
} }
}
assert_not_nil (mail = ActionMailer::Base.deliveries.last) assert_not_nil (mail = ActionMailer::Base.deliveries.last)
assert_mail_body_match '0.0.0.0', mail assert_mail_body_match '0.0.0.0', mail
...@@ -308,7 +318,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -308,7 +318,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_non_admin_should_not_send_security_notification def test_create_non_admin_should_not_send_security_notification
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
post :create, post :create, :params => {
:user => { :user => {
:firstname => 'Edgar', :firstname => 'Edgar',
:lastname => 'Schmoe', :lastname => 'Schmoe',
...@@ -318,12 +328,13 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -318,12 +328,13 @@ class UsersControllerTest < Redmine::ControllerTest
:mail => 'eschmoe@example.foo', :mail => 'eschmoe@example.foo',
:admin => '0' :admin => '0'
} }
}
assert_nil ActionMailer::Base.deliveries.last assert_nil ActionMailer::Base.deliveries.last
end end
def test_edit def test_edit
get :edit, :id => 2 get :edit, :params => {:id => 2}
assert_response :success assert_response :success
assert_template 'edit' assert_template 'edit'
assert_equal User.find(2), assigns(:user) assert_equal User.find(2), assigns(:user)
...@@ -332,16 +343,18 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -332,16 +343,18 @@ class UsersControllerTest < Redmine::ControllerTest
def test_edit_registered_user def test_edit_registered_user
assert User.find(2).register! assert User.find(2).register!
get :edit, :id => 2 get :edit, :params => {:id => 2}
assert_response :success assert_response :success
assert_select 'a', :text => 'Activate' assert_select 'a', :text => 'Activate'
end end
def test_update def test_update
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => 2, put :update, :params => {
:user => {:firstname => 'Changed', :mail_notification => 'only_assigned'}, :id => 2,
:pref => {:hide_mail => '1', :comments_sorting => 'desc'} :user => {:firstname => 'Changed', :mail_notification => 'only_assigned'},
:pref => {:hide_mail => '1', :comments_sorting => 'desc'}
}
user = User.find(2) user = User.find(2)
assert_equal 'Changed', user.firstname assert_equal 'Changed', user.firstname
assert_equal 'only_assigned', user.mail_notification assert_equal 'only_assigned', user.mail_notification
...@@ -352,14 +365,20 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -352,14 +365,20 @@ class UsersControllerTest < Redmine::ControllerTest
def test_update_with_failure def test_update_with_failure
assert_no_difference 'User.count' do assert_no_difference 'User.count' do
put :update, :id => 2, :user => {:firstname => ''} put :update, :params => {
:id => 2,
:user => {:firstname => ''}
}
end end
assert_response :success assert_response :success
assert_template 'edit' assert_template 'edit'
end end
def test_update_with_group_ids_should_assign_groups def test_update_with_group_ids_should_assign_groups
put :update, :id => 2, :user => {:group_ids => ['10']} put :update, :params => {
:id => 2,
:user => {:group_ids => ['10']}
}
user = User.find(2) user = User.find(2)
assert_equal [10], user.group_ids assert_equal [10], user.group_ids
end end
...@@ -372,7 +391,10 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -372,7 +391,10 @@ class UsersControllerTest < Redmine::ControllerTest
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1' Setting.bcc_recipients = '1'
put :update, :id => u.id, :user => {:status => User::STATUS_ACTIVE} put :update, :params => {
:id => u.id,
:user => {:status => User::STATUS_ACTIVE}
}
assert u.reload.active? assert u.reload.active?
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_not_nil mail assert_not_nil mail
...@@ -384,7 +406,11 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -384,7 +406,11 @@ class UsersControllerTest < Redmine::ControllerTest
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1' Setting.bcc_recipients = '1'
put :update, :id => 2, :user => {:password => 'newpass123', :password_confirmation => 'newpass123'}, :send_information => '1' put :update, :params => {
:id => 2,
:user => {:password => 'newpass123', :password_confirmation => 'newpass123'},
:send_information => '1'
}
u = User.find(2) u = User.find(2)
assert u.check_password?('newpass123') assert u.check_password?('newpass123')
...@@ -398,11 +424,15 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -398,11 +424,15 @@ class UsersControllerTest < Redmine::ControllerTest
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1' Setting.bcc_recipients = '1'
put :update, :id => 2, :user => { put :update, :params => {
:generate_password => '1', :id => 2,
:password => '', :user => {
:password_confirmation => '' :generate_password => '1',
}, :send_information => '1' :password => '',
:password_confirmation => ''
},
:send_information => '1'
}
mail = ActionMailer::Base.deliveries.last mail = ActionMailer::Base.deliveries.last
assert_not_nil mail assert_not_nil mail
...@@ -413,12 +443,15 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -413,12 +443,15 @@ class UsersControllerTest < Redmine::ControllerTest
end end
def test_update_without_generate_password_should_not_change_password def test_update_without_generate_password_should_not_change_password
put :update, :id => 2, :user => { put :update, :params => {
:firstname => 'changed', :id => 2, :user => {
:generate_password => '0', :firstname => 'changed',
:password => '', :generate_password => '0',
:password_confirmation => '' :password => '',
}, :send_information => '1' :password_confirmation => ''
},
:send_information => '1'
}
user = User.find(2) user = User.find(2)
assert_equal 'changed', user.firstname assert_equal 'changed', user.firstname
...@@ -431,14 +464,17 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -431,14 +464,17 @@ class UsersControllerTest < Redmine::ControllerTest
u.auth_source = AuthSource.find(1) u.auth_source = AuthSource.find(1)
u.save! u.save!
put :update, :id => u.id, :user => {:auth_source_id => '', :password => 'newpass123', :password_confirmation => 'newpass123'} put :update, :params => {
:id => u.id,
:user => {:auth_source_id => '', :password => 'newpass123', :password_confirmation => 'newpass123'}
}
assert_equal nil, u.reload.auth_source assert_equal nil, u.reload.auth_source
assert u.check_password?('newpass123') assert u.check_password?('newpass123')
end end
def test_update_notified_project def test_update_notified_project
get :edit, :id => 2 get :edit, :params => {:id => 2}
assert_response :success assert_response :success
assert_template 'edit' assert_template 'edit'
u = User.find(2) u = User.find(2)
...@@ -446,11 +482,13 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -446,11 +482,13 @@ class UsersControllerTest < Redmine::ControllerTest
assert_equal [1, 2, 5], u.notified_projects_ids.sort assert_equal [1, 2, 5], u.notified_projects_ids.sort
assert_select 'input[name=?][value=?]', 'user[notified_project_ids][]', '1' assert_select 'input[name=?][value=?]', 'user[notified_project_ids][]', '1'
assert_equal 'all', u.mail_notification assert_equal 'all', u.mail_notification
put :update, :id => 2, put :update, :params => {
:user => { :id => 2,
:mail_notification => 'selected', :user => {
:notified_project_ids => [1, 2] :mail_notification => 'selected',
} :notified_project_ids => [1, 2]
}
}
u = User.find(2) u = User.find(2)
assert_equal 'selected', u.mail_notification assert_equal 'selected', u.mail_notification
assert_equal [1, 2], u.notified_projects_ids.sort assert_equal [1, 2], u.notified_projects_ids.sort
...@@ -461,7 +499,10 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -461,7 +499,10 @@ class UsersControllerTest < Redmine::ControllerTest
user.pref[:no_self_notified] = '1' user.pref[:no_self_notified] = '1'
user.pref.save user.pref.save
put :update, :id => 2, :user => {:status => 3} put :update, :params => {
:id => 2,
:user => {:status => 3}
}
assert_response 302 assert_response 302
user = User.find(2) user = User.find(2)
assert_equal 3, user.status assert_equal 3, user.status
...@@ -470,8 +511,9 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -470,8 +511,9 @@ class UsersControllerTest < Redmine::ControllerTest
def test_update_assign_admin_should_send_security_notification def test_update_assign_admin_should_send_security_notification
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => 2, :user => { put :update, :params => {
:admin => 1 :id => 2,
:user => {:admin => 1}
} }
assert_not_nil (mail = ActionMailer::Base.deliveries.last) assert_not_nil (mail = ActionMailer::Base.deliveries.last)
...@@ -489,8 +531,9 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -489,8 +531,9 @@ class UsersControllerTest < Redmine::ControllerTest
user.save! user.save!
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => user.id, :user => { put :update, :params => {
:admin => 0 :id => user.id,
:user => {:admin => 0}
} }
assert_not_nil (mail = ActionMailer::Base.deliveries.last) assert_not_nil (mail = ActionMailer::Base.deliveries.last)
...@@ -508,8 +551,9 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -508,8 +551,9 @@ class UsersControllerTest < Redmine::ControllerTest
user.save! user.save!
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => 2, :user => { put :update, :params => {
:status => Principal::STATUS_LOCKED :id => 2,
:user => {:status => Principal::STATUS_LOCKED}
} }
assert_not_nil (mail = ActionMailer::Base.deliveries.last) assert_not_nil (mail = ActionMailer::Base.deliveries.last)
...@@ -523,7 +567,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -523,7 +567,7 @@ class UsersControllerTest < Redmine::ControllerTest
# if user is already locked, destroying should not send a second mail # if user is already locked, destroying should not send a second mail
# (for active admins see furtherbelow) # (for active admins see furtherbelow)
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
delete :destroy, :id => 1 delete :destroy, :params => {:id => 1}
assert_nil ActionMailer::Base.deliveries.last assert_nil ActionMailer::Base.deliveries.last
end end
...@@ -533,8 +577,9 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -533,8 +577,9 @@ class UsersControllerTest < Redmine::ControllerTest
user.admin = true user.admin = true
user.save! user.save!
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => user.id, :user => { put :update, :params => {
:status => Principal::STATUS_ACTIVE :id => user.id,
:user => {:status => Principal::STATUS_ACTIVE}
} }
assert_not_nil (mail = ActionMailer::Base.deliveries.last) assert_not_nil (mail = ActionMailer::Base.deliveries.last)
...@@ -548,15 +593,16 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -548,15 +593,16 @@ class UsersControllerTest < Redmine::ControllerTest
def test_update_admin_unrelated_property_should_not_send_security_notification def test_update_admin_unrelated_property_should_not_send_security_notification
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
put :update, :id => 1, :user => { put :update, :params => {
:firstname => 'Jimmy' :id => 1,
:user => {:firstname => 'Jimmy'}
} }
assert_nil ActionMailer::Base.deliveries.last assert_nil ActionMailer::Base.deliveries.last
end end
def test_destroy def test_destroy
assert_difference 'User.count', -1 do assert_difference 'User.count', -1 do
delete :destroy, :id => 2 delete :destroy, :params => {:id => 2}
end end
assert_redirected_to '/users' assert_redirected_to '/users'
assert_nil User.find_by_id(2) assert_nil User.find_by_id(2)
...@@ -566,14 +612,14 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -566,14 +612,14 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 3 @request.session[:user_id] = 3
assert_no_difference 'User.count' do assert_no_difference 'User.count' do
get :destroy, :id => 2 get :destroy, :params => {:id => 2}
end end
assert_response 403 assert_response 403
end end
def test_destroy_should_redirect_to_back_url_param def test_destroy_should_redirect_to_back_url_param
assert_difference 'User.count', -1 do assert_difference 'User.count', -1 do
delete :destroy, :id => 2, :back_url => '/users?name=foo' delete :destroy, :params => {:id => 2, :back_url => '/users?name=foo'}
end end
assert_redirected_to '/users?name=foo' assert_redirected_to '/users?name=foo'
end end
...@@ -583,7 +629,7 @@ class UsersControllerTest < Redmine::ControllerTest ...@@ -583,7 +629,7 @@ class UsersControllerTest < Redmine::ControllerTest
user.admin = true user.admin = true
user.save! user.save!
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
delete :destroy, :id => user.id delete :destroy, :params => {:id => user.id}