title: Capybara not working with factory girl
body: <p>I'm using minitest with factory girl and capybara for integration tests. Capybara works fine when I don't user factory girl to create a user object, like this:</p>
  
  <pre><code>it "logs in a user successfully" do
      visit signup_path
      fill_in "Email", :with =&gt; "joey@ramones.com"
      fill_in "Password", :with =&gt; "rockawaybeach"
      fill_in "Password confirmation", :with =&gt; "rockawaybeach"
      click_button "Create User"
      current_path == "/"
      page.text.must_include "Signed up!"
      visit login_path
      fill_in "Email", :with =&gt; "joey@ramones.com"
      fill_in "Password", :with =&gt; "rockawaybeach"
      check "Remember me"
      click_button "Log in"
      current_path == "/dashboard"
      page.text.must_include "Logged in!"
      page.text.must_include "Your Dashboard"
    end
  </code></pre>
  
  <p>But as soon as I try to create a user with factory girl weird things start happening, such as the visit method and click_button methods stop working. For instance, there doesn't seem to be anything wrong with this test:</p>
  
  <pre><code>require "test_helper"
  
  describe "Password resets" do
    before(:each) do
      @user = FactoryGirl.create(:user)
    end
  
    it "emails user when requesting password reset" do
      visit login_path
      click_link "password"
      fill_in "Email", :with =&gt; user.email
      click_button "Reset my password"
    end
  
  end
  </code></pre>
  
  <p>And here's my factories.rb:</p>
  
  <pre><code>FactoryGirl.define do
    factory :user do |f|
      f.sequence(:email) { |n| "foo#{n}@example.com" }
      f.password "secret"
      f.password_confirmation "secret"
    end
  end
  </code></pre>
  
  <p>Here's the actual error that I'm getting:</p>
  
  <pre><code>est_0001_emails user when requesting password reset      0:00:01.624 ERROR
          undefined local variable or method `login_path' for #&lt;#&lt;Class:0x007fc2db48d820&gt;:0x007fc2df337e40&gt;
  </code></pre>
  
  <p>But, <code>visit login_path</code> works fine if I remove <code>@user = FactoryGirl.create(:user)</code> </p>
  
  <p>Is this a bug with Capybara? Or am I doing something wrong here?</p>