small medium large xlarge

22 Aug 2012, 20:51
Gerson Azevedo (1 post)

Hey, I’m getting this error when I try to run tests to test my sessions controller.

Weird thing is that it works on the app, but the test gives me this error.

Here is the error: BCrypt::Errors::InvalidHash invalid hash on test

# My fixture code
  username: gerson
  password_digest: <%= BCrypt::Password.create('secret') %>​

# My test code

  test "should login fail" do 
    dave = users(:one)
    post :create, username: dave.username, password: 'wrong'
    assert_redirected_to login_url

Thanks for the help.

You must be logged in to comment