Ruby fixtures error with password column

Posted by user347998 on Stack Overflow See other posts from Stack Overflow or by user347998
Published on 2010-06-02T08:46:44Z Indexed on 2010/06/06 9:02 UTC
Read the original article Hit count: 335

Filed under:
|
|

I am trying to load a fixture for my tests which has a password column (binary datatype). The tool i am using uses EzCrypto gem for encrypting and decrypting passwords before they are stored/retrieved. Now if my column is binary i thought rails would automatically store the password as encrypted - but all i get is:

1) Error: test_is_working(FirstTest): RuntimeError: Failed to decode the field. Incorrect key? /Library/Ruby/Gems/1.8/gems/mislav-will_paginate-2.3.11/lib/will_paginate/finder.rb:170:in method_missing' unit/first_test.rb:8:insetup'

2) Error: test_sanity(FirstTest): RuntimeError: Failed to decode the field. Incorrect key? unit/first_test.rb:8:in `setup'

Fixture file looks like this:
first_hussle:
    type: FirstAccount
    user: jsewq
    username: [email protected]
    password: 'abc123'

any clues?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about testing