1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/test_models.rb
Carlos Antonio da Silva 2261005ed5 Refactor a bit to avoid two model attributes lookup
Tidy up tests a bit.
2012-12-04 17:37:12 -02:00

27 lines
801 B
Ruby

class Configurable < User
devise :database_authenticatable, :confirmable, :rememberable, :timeoutable, :lockable,
:stretches => 15, :pepper => 'abcdef', :allow_unconfirmed_access_for => 5.days,
:remember_for => 7.days, :timeout_in => 15.minutes, :unlock_in => 10.days
end
class WithValidation < Admin
devise :database_authenticatable, :validatable, :password_length => 2..6
end
class UserWithValidation < User
validates_presence_of :username
end
class UserWithVirtualAttributes < User
devise :case_insensitive_keys => [ :email, :email_confirmation ]
validates :email, :presence => true, :confirmation => {:on => :create}
attr_accessible :email, :email_confirmation
end
class Several < Admin
devise :validatable
devise :lockable
end
class Inheritable < Admin
end