summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 17:51:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 17:51:16 +0000
commit97a647c1e5d43106d97d3b07febfd659eb5681c1 (patch)
treefe5d3519bf622c06210093db3bb126a57fb2684d /test/unit/user_test.rb
parent1da39caad3d2bded1da854f44b99d902beca2494 (diff)
downloadredmine-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.rb8
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 "