ruby on rails - how to test with sorcery -
i have little problem sorcery
test :
def setup @user = users(:anouar) end test "should valid" assert @user.valid? end and fixture :
anouar: email: anouar@gmail.com salt: <%= salt = "asdasdastr4325234324sdfds" %> crypted_password: <%= sorcery::cryptoproviders::bcrypt.encrypt("secret", salt) %> and model :
class user < activerecord::base authenticates_with_sorcery! validates :email, presence: true, length: { maximum: 255 }, email_format: { message: 'has invalid format' }, uniqueness: { case_sensitive: false } end until here when run bundle exec rake test test green
but when add validation of password
validates :password, presence: true, confirmation: true, length: { minimum: 3} the test "should valid" fail
please help?
did try provide directly password in fixture ?
Comments
Post a Comment