Skip to content

Instantly share code, notes, and snippets.

@lucassmagal
Created September 2, 2012 20:19
Show Gist options
  • Save lucassmagal/3604190 to your computer and use it in GitHub Desktop.
Save lucassmagal/3604190 to your computer and use it in GitHub Desktop.
Fabricate user
class Usuario < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :nome, :email, :password, :password_confirmation, :remember_me
end
Fabricator(:usuario) do
nome { Faker::Name.name }
email { Faker::Internet.email }
password '123123'
password_confirmation '123123'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment