diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-04 06:43:48 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-04 06:43:48 +0000 |
commit | 420e70180c8947a39a15ce14ba5946ddbf824635 (patch) | |
tree | 7d7e5c255d92cf0c6641f067a880bee7884894bb /test/unit/user_preference_test.rb | |
parent | 1de2c1c2af3672ffa6834e77e8c735152f760db9 (diff) | |
download | redmine-420e70180c8947a39a15ce14ba5946ddbf824635.tar.gz redmine-420e70180c8947a39a15ce14ba5946ddbf824635.zip |
add unit test to ensure user preference others is hash in saving
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8069 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_preference_test.rb')
-rw-r--r-- | test/unit/user_preference_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb index 76c91db66..20bdcaaef 100644 --- a/test/unit/user_preference_test.rb +++ b/test/unit/user_preference_test.rb @@ -40,4 +40,18 @@ class UserPreferenceTest < ActiveSupport::TestCase user.reload assert_equal 'value', user.pref['preftest'] end + + def test_others_hash + user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") + user.login = "newuser" + user.password, user.password_confirmation = "password", "password" + assert user.save + assert_nil user.preference + up = UserPreference.new(:user => user) + assert_kind_of Hash, up.others + up.others = nil + assert_nil up.others + assert up.save + assert_kind_of Hash, up.others + end end |