Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. FactoryGirl.define do
  2. factory :user do
  3. email "g@g.com"
  4. password "123123"
  5. password_confirmation { "123123" }
  6. end
  7. end
  8.  
  9. describe User do
  10. # pending "add some examples to (or delete) #{__FILE__}"
  11.  
  12. @user = FactoryGirl.create(:user)
  13.  
  14.  
  15. subject(:user)
  16.  
  17. it { should respond_to(:email) }
  18. it { should respond_to(:password) }
  19.  
  20. it { should be_valid }
  21. end
  22.  
  23. #<User id: 13, email: "email1@factory.com", encrypted_password: "$2a$04$.lWs6yadJu/Ya67xi.W1F.fd6sWLGkzc/59.lgTi0sA7...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: "2012-08-27 15:48:23", updated_at: "2012-08-27 15:48:23">
  24.  
  25. class User < ActiveRecord::Base
  26. # Include default devise modules. Others available are:
  27. # :token_authenticatable, :confirmable,
  28. # :lockable, :timeoutable and :omniauthable
  29. devise :database_authenticatable, :registerable,
  30. :recoverable, :rememberable, :trackable, :validatable
  31.  
  32. # Setup accessible (or protected) attributes for your model
  33. attr_accessible :email, :password, :password_confirmation, :remember_me
  34. # attr_accessible :title, :body
  35.  
  36. validates :email, :presence => true
  37. validates :password, :presence => true
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement