Project

General

Profile

Feature #37679 » 37679.patch

Go MAEDA, 2023-06-23 02:43

View differences:

app/models/user.rb
110 110
  # Login must contain letters, numbers, underscores only
111 111
  validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
112 112
  validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
113
  validates_length_of :firstname, :lastname, :maximum => 30
113
  validates_length_of :firstname, :maximum => 30
114
  validates_length_of :lastname, :maximum => 255
114 115
  validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
115 116
  Setting::PASSWORD_CHAR_CLASSES.each do |k, v|
116 117
    validates_format_of :password, :with => v, :message => :"must_contain_#{k}", :allow_blank => true, :if => Proc.new {Setting.password_required_char_classes.include?(k)}
test/unit/user_test.rb
577 577
    end
578 578
  end
579 579

  
580
  def test_lastname_should_accept_255_characters
581
    u = User.first
582
    u.lastname = 'a' * 255
583
    assert u.save
584
  end
585

  
580 586
  def test_today_should_return_the_day_according_to_user_time_zone
581 587
    preference = User.find(1).pref
582 588
    date = Date.new(2012, 05, 15)
(2-2/2)