ActiveModel::SecurePassword undefined method `password_digest='
问题 I try to use rails 3.1 ActiveModel::SecurePassword by following http://bcardarella.com/post/4668842452/exploring-rails-3-1-activemodel-securepassword and I end up with red light ... user.rb class User < ActiveRecord::Base has_secure_password validates :password, :presence => { :on => :create } end factory.rb Factory.define :user do |f| f.email "foo@bar.com" f.password "foobar" f.password_confirmation { |u| u.password } end spec_user.rb describe User do it "should authenticate with matching