Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am new in ruby on rails.I just pass this tutorials. when I doing I found errors same you.</p> <p>I hope my solved can help you.</p> <p><strong>in your user.rb</strong><br> remove line: attr_accessor and edit has_secure password to has_secure_password (add underscore)</p> <pre><code>class User &lt; ActiveRecord::Base attr_accessible :email, :name, :password, :password_confirmation has_secure_password enter code here before_save { |user| user.email = email.downcase } validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, format: { with: VALID_EMAIL_REGEX}, uniqueness: {case_sensitive: false} validates :password, presence: true, length:{ minimum: 6 } validates :password_confirmation, presence: true end </code></pre> <p><strong>in your user.spec.rb</strong></p> <p>1) you missed 'end' tag in <code>describe "when password is not present"</code></p> <p>2) Change test <code>describe 'with a password that's too short'</code> from <code>it { should be_valid}</code> to <code>it { should be_invalid }</code> I think it should be invalid if password less than 5.</p> <p>3) finally if you want to test pass authenticate you should change your email end with .com or any that matches with VALID_EMAIL_REGEX in user.rb like:</p> <pre><code>before do @user = User.new(name: "Example User", email: "User@example.com", password: "foobar", password_confirmation:"foobar") end </code></pre> <p>I wish this help you.</p> <p>sorry for my bad english.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload