我試圖建立一個工廠與authlogic定義的「賬戶」的模式:Authlogic +工廠女孩:驗證失敗:密碼太短(最小爲4個字符)
class Account < UuidEnabled
acts_as_authentic do |c|
c.validate_password_field = true
c.require_password_confirmation = true
c.ignore_blank_passwords = false
c.crypto_provider = Authlogic::CryptoProviders::Sha512
end
end
這是我廠:
FactoryGirl.define do
factory :account do
sequence(:email) { |n| "account_#{n}@example.com"}
password = "1234"
password_confirmation { |a| a.password} # to make things work even if the password is changed
end
end
我的測試失敗,
ActiveRecord::RecordInvalid: Validation failed: Password is too short (minimum is 4 characters), Password confirmation is too short (minimum is 4 characters)
謝謝!刪除'='解決了這個問題 – Nimo