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

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -