I got some problems with my integration test. I have a form were a new
user can sign up. If the form is blank and submitted the normal error
occur. The error div has an id "error_explanation". In my integration
test i try to match it but the test is always red. Here some Code:
# encoding : utf-8
describe "Users" do
describe "signup" do
describe "failure" do
it "should not make a new user" do
fill_in "Benutzername", :with => ""
fill_in "Email", :with => ""
fill_in "Passwort", :with => ""
fill_in "Passwort bestätigen", :with => ""
response.should have_selector("div", :id => "error_explanation")
end.should_not change(User, :count)
Here is the error:
expected following output to contain a <div id='error_explanation'/> tag
and the whole html output.
I checked my output and the strange thing is that i even can't find the
form in the output. It looks like the test is checking the index page
instead of the one tried to reach with the visit registrieren_path.
I'm using Rspec Rails v.2.7.0 with Webrat 0.7.3
Hope someone got a hint for me :)
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@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.