i'm in the process of writing some integration tests on a rails 2.3.8
app and am running into a bit of difficulty:
the following works just fine for me:
get "/login"
assert_response :success
assert_template "user_sessions/new"
post "/user_session", :user_session => {:login =>
'[email protected]', :password => 'secret'}
assert_redirected_to products_path
assert_equal "Logged in successfully", flash[:notice]
however, the following does not work:
get "/login"
assert_response :success
assert_template "user_sessions/new"
post_via_redirect "/user_session", :user_session => {:login =>
'[email protected]', :password => 'secret'}
assert_select "div.flash", "Logged in successfully"
assert_equal "Logged in successfully", flash[:notice]
The last two asserts both fail as the flash[:notice] doesn't seem to
be there anymore.
When I log in using a browser I do get a <div class="flash
notice">Logged in successfully</div> and I'd like my integration test
to actually verify that this is actually showing up in the resulting
page that one gets when doing a login. Is this a bug in rails
integration tests, or am I overlooking something obvious?
- Thanks,
Francois
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.