Feature #6166 » feature-6166.diff
app/models/user.rb (working copy) | ||
---|---|---|
106 | 106 |
validates_presence_of :login, :firstname, :lastname, :if => Proc.new { |user| !user.is_a?(AnonymousUser) } |
107 | 107 |
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false |
108 | 108 |
# Login must contain letters, numbers, underscores only |
109 |
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
|
|
109 |
validates_format_of :login, :with => /\A[[:alnum:]_\-@\.]*\z/i
|
|
110 | 110 |
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT |
111 | 111 |
validates_length_of :firstname, :lastname, :maximum => 30 |
112 | 112 |
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true |
test/unit/user_test.rb (working copy) | ||
---|---|---|
105 | 105 |
assert user.save |
106 | 106 |
end |
107 | 107 | |
108 |
def test_login_with_umlauts |
|
109 |
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") |
|
110 |
user.login = "Jörg" |
|
111 |
assert user.valid? |
|
112 |
assert user.save |
|
113 |
end |
|
114 | ||
108 | 115 |
def test_generate_password_should_respect_minimum_password_length |
109 | 116 |
with_settings :password_min_length => 15 do |
110 | 117 |
user = User.generate!(:generate_password => true) |
- « Previous
- 1
- 2
- Next »