diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-11 17:51:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-11 17:51:16 +0000 |
commit | 97a647c1e5d43106d97d3b07febfd659eb5681c1 (patch) | |
tree | fe5d3519bf622c06210093db3bb126a57fb2684d /test/unit/user_test.rb | |
parent | 1da39caad3d2bded1da854f44b99d902beca2494 (diff) | |
download | redmine-97a647c1e5d43106d97d3b07febfd659eb5681c1.tar.gz redmine-97a647c1e5d43106d97d3b07febfd659eb5681c1.zip |
Validate status of users and groups.
git-svn-id: http://svn.redmine.org/redmine/trunk@15320 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r-- | test/unit/user_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index ad068757f..ef23e397c 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -52,6 +52,14 @@ class UserTest < ActiveSupport::TestCase assert_kind_of User, @jsmith end + def test_should_validate_status + user = User.new + user.status = 0 + + assert !user.save + assert_include I18n.translate('activerecord.errors.messages.invalid'), user.errors[:status] + end + def test_mail_should_be_stripped u = User.new u.mail = " foo@bar.com " |