summaryrefslogtreecommitdiffstats
path: root/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-11-29 21:43:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-11-29 21:43:29 +0000
commit6032263d9b10365c4c8ab0378e38f9a75015b416 (patch)
tree0694d0420ab908a38afd601b8eab36817a2b6a63 /test/functional/users_controller_test.rb
parente494983e1f746cd6723ffe908c426235eeb57f44 (diff)
downloadredmine-6032263d9b10365c4c8ab0378e38f9a75015b416.tar.gz
redmine-6032263d9b10365c4c8ab0378e38f9a75015b416.zip
Fixed that preferences are not preserved when adding a user fails (#15552).
git-svn-id: http://svn.redmine.org/redmine/trunk@12350 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r--test/functional/users_controller_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 5959da10e..9966790e3 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -250,6 +250,25 @@ class UsersControllerTest < ActionController::TestCase
assert_template 'new'
end
+ def test_create_with_failure_sould_preserve_preference
+ assert_no_difference 'User.count' do
+ post :create,
+ :user => {},
+ :pref => {
+ 'no_self_notified' => '1',
+ 'hide_mail' => '1',
+ 'time_zone' => 'Paris',
+ 'comments_sorting' => 'desc',
+ 'warn_on_leaving_unsaved' => '0'
+ }
+ end
+ assert_response :success
+ assert_template 'new'
+
+ assert_select 'select#pref_time_zone option[selected=selected]', :text => /Paris/
+ assert_select 'input#pref_no_self_notified[value=1][checked=checked]'
+ end
+
def test_edit
get :edit, :id => 2
assert_response :success