Hi all,
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
require 'spec_helper'

describe "Users" do

  describe "signup" do
    describe "failure" do

      it "should not make a new user" do
        lambda do
          visit registrieren_path
          fill_in "Benutzername", :with => ""
          fill_in "Email", :with => ""
          fill_in "Passwort", :with => ""
          fill_in "Passwort bestätigen", :with => ""
          click_button
          response.should render_template('users/new')
          response.should have_selector("div", :id => "error_explanation")
        end.should_not change(User, :count)
      end
    end
  end
end


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

Best regards

Greg

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to