From 97a647c1e5d43106d97d3b07febfd659eb5681c1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 11 Apr 2016 17:51:16 +0000 Subject: Validate status of users and groups. git-svn-id: http://svn.redmine.org/redmine/trunk@15320 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/user_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/unit/user_test.rb') 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 " -- cgit v1.2.3