I'm trying to build a factory for an "account" model defined with authlogic:
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
This is my factory:
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
My test fails with
ActiveRecord::RecordInvalid: Validation failed: Password is too short (minimum is 4 characters), Password confirmation is too short (minimum is 4 characters)
Think this is just a typo, try:
Note that the equals sign after
password
has been removed