RailsCasts Pro episodes are now free!

Learn more or hide this

Mockra's Profile

GitHub User: mockra

Site: www.mockra.com

Comments by Mockra

Avatar

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:

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

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

ruby
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:

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