RailsCasts Pro episodes are now free!

Learn more or hide this

Mockra's Profile

GitHub User: mockra

Site: www.mockra.com

Comments by Mockra


Quick question, I'm currently writing integration tests for a Sorcery powered Rails 3.1 app. I'm having some issues when trying to fill in the login form. This is how my test is set up:

user = create(:user)
visit login_path
fill_in 'username', :with => user.username
fill_in 'password', :with => user.password
click_button 'Log In'

That current test setup doesn't work; however, if I do:

fill_in 'password', :with => 'foobar'

It does work. Just wondering why this isn't working for me. I assume it has something to do with encrypting the password during setup or something.

Here's my factory if anyone is interested:

sequence(:username) { |n| "foo#{n}" }
password 'foobar'
email { "#{username}@example.com" }