2010-06-02 4 views
1

암호 열 (바이너리 데이터 유형)이있는 테스트를 위해 조명기를로드하려고합니다. 내가 사용하고있는 도구는 저장/검색되기 전에 암호를 암호화하고 해독하는 데 EzCrypto gem을 사용합니다. 내 열이 이진 않습니다 경우 암호화로 나는 레일이 자동으로 암호를 저장하는 것이라고 생각 -하지만 내가 가진 전부입니다Ruby fixtures error with password column

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:in setup 

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' 

어떤 단서?

답변

0

ezcrypto를 사용하여 조명기의 암호를 암호화해야합니다. 당신의 조명기가 users 테이블을위한 것이고, 당신은 user_crypto_provider.rb 파일/클래스가 정의되어 있다고 가정합니다.

password: <%= UserCryptoProvider.encrypt('abc123') %>