Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6196665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:41:00+00:00 2026-05-24T03:41:00+00:00

I use rspec-guard to run my tests continuously, but sometimes the tests fails because

  • 0

I use rspec-guard to run my tests continuously, but sometimes the tests fails because of:

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 #<RSpec::Core::ExampleGroup::Nested_1:0x00000100ad5fd8>
     # ./spec/requests/signup_spec.rb:4:in `block (2 levels) in <top (required)>'

  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 <top (required)>'

Sometimes they work and sometimes they don’t work.. I dont know why..

Can you help me?

EDIT:
I use following versions:

  • ruby 1.9.2-p290
  • rails 3.1.rc4
  • rspec (2.6.0)
  • rspec-rails (2.6.1)
  • factory_girl (2.0.0.rc4)
  • factory_girl_rails (1.1.rc1)

And as you can see, the routes arent working too: new_user_path not found…?

And this is my request spec:

# -*- 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 => 'none@example.net'
    fill_in 'user_password', :with => ''
    fill_in 'user_password_confirmation', :with => ''
    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 => user.unconfirmed_email
    fill_in 'user_password', :with => user.unconfirmed_email
    fill_in 'user_password_confirmation', :with => 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:41:00+00:00Added an answer on May 24, 2026 at 3:41 am

    Argh… found the solution.. I forgot to include

    require 'spec_helper.rb'
    

    in my specs…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use rspec on my rails application I run spec path/to/spec/spec.rb
When I run ./script/generate scaffold Whatever, it creates ActionController::TestCase tests for me, but I
I want to use RSpec mocks to provide canned input to a block. Ruby:
When dropping the use of rspec and rspec-rails plugins and switching to the gem
When should I use specs for Rails application and when Cucumber (former rspec-stories)? I
I use Firebug and the Mozilla JS console heavily, but every now and then
I'm attempting to use rspec in a rails project I've just upgraded to rails
Is it possible to use RSpec .should(change(...)).by(...) with float numbers and set the compare
I've just installed a ZenTest to use autotest in my project. I use rspec
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.