title: uninitialized constant RSpec::Core::ExampleGroup::Nested_1::Factory
body: <p>I use rspec-guard to run my tests continuously, but sometimes the tests fails because of:</p>
  
  <pre><code>Running: spec/requests/signup_spec.rb
  FF
  
  Failures:
  
    1) Signup does not email confirmation mail after signup
       Failure/Error: visit new_user_path
       NameError:
         undefined local variable or method `new_user_path' for #&lt;RSpec::Core::ExampleGroup::Nested_1:0x00000100ad5fd8&gt;
       # ./spec/requests/signup_spec.rb:4:in `block (2 levels) in &lt;top (required)&gt;'
  
    2) Signup should email confirmation mail after signup
       Failure/Error: user = Factory.build(:user)
       NameError:
         uninitialized constant RSpec::Core::ExampleGroup::Nested_1::Factory
       # ./spec/requests/signup_spec.rb:15:in `block (2 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>Sometimes they work and sometimes they don't work.. I dont know why..</p>
  
  <p>Can you help me?</p>
  
  <p><strong>EDIT:</strong>
  I use following versions:</p>
  
  <ul>
  <li>ruby 1.9.2-p290 </li>
  <li>rails 3.1.rc4</li>
  <li>rspec (2.6.0) </li>
  <li>rspec-rails (2.6.1)</li>
  <li>factory_girl (2.0.0.rc4)</li>
  <li>factory_girl_rails (1.1.rc1) </li>
  </ul>
  
  <p>And as you can see, the routes arent working too: new_user_path not found...?</p>
  
  <p>And this is my request spec:</p>
  
  <pre><code># -*- encoding : utf-8 -*-
  describe "Signup" do
    it "does not email confirmation mail after signup" do
      visit new_user_path
      fill_in 'user_unconfirmed_email', :with =&gt; 'none@example.net'
      fill_in 'user_password', :with =&gt; ''
      fill_in 'user_password_confirmation', :with =&gt; ''
      click_button "Create User"
      current_path.should eq(user_path)
      page.should have_content("is too short")
      last_email.should be_nil
    end
  
    it "should email confirmation mail after signup" do
      user = Factory.build(:user)
      visit root_path
      fill_in 'user_unconfirmed_email', :with =&gt; user.unconfirmed_email
      fill_in 'user_password', :with =&gt; user.unconfirmed_email
      fill_in 'user_password_confirmation', :with =&gt; user.unconfirmed_email
      click_button "Create User"
      current_path.should eq(root_path)
      page.should have_content("You successfully signed up! An email with your activation link was sent to your mail address.")
      last_email.to.should include(user.unconfirmed_email)
      last_email.body.should include(user.email_confirmation_key)
      open_email(user.unconfirmed_email)
      click_first_link_in_email # email spec
      current_path.should eq(new_user_path)
      page.should have_content "Your email was successfully confirmed. You are now able to log in with it!"
    end
  end
  </code></pre>