Skip to content
Browse files

tweaking validations for tests

  • Loading branch information...
1 parent 77def9b commit 36c9ae99b380177c68b162ea5b1bf7e423341619 mcansky committed Feb 16, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/models/user.rb
View
2 app/models/user.rb
@@ -34,9 +34,11 @@ class User < ActiveRecord::Base
before_validation :set_initial_name
validates_exclusion_of :name, :in => ["admin", "login", "logout"], :message => "name %{value} is reserved."
+ validates_exclusion_of :name, :in => [nil], :message => "can't be blank"
validates_presence_of :name, :email, :message => "can't be blank"
validates_uniqueness_of :name, :case_sensitive => true
validates_uniqueness_of :email, :case_sensitive => true
+ validates_length_of :name, :minimum => 1, :message => "can't be blank"
#validates_length_of :password, :minimum => 8
# check strength of password : again 8 chars min, at least one capitaled letter, at least one normal letter, at least one non alpha characters
#validates_format_of :password, :with => /^.*(?=.{6,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d\W]).*$/

0 comments on commit 36c9ae9

Please sign in to comment.
Something went wrong with that request. Please try again.