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 9165427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:54:27+00:00 2026-06-17T14:54:27+00:00

When I run rspec spec/requests/users_spec.rb I get this: admin@Administrators-MacBook-Pro:~/Desktop/sample_app$ rspec spec/requests/users_spec.rb No DRb server

  • 0

When I run rspec spec/requests/users_spec.rb

I get this:

admin@Administrators-MacBook-Pro:~/Desktop/sample_app$ rspec spec/requests/users_spec.rb
No DRb server is running. Running in local process instead ...
Rack::File headers parameter replaces cache_control after Rack 1.5.
/Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/factory_girl-4.1.0/lib/factory_girl/syntax/default.rb:6:in `define': wrong number of arguments (1 for 0) (ArgumentError)
    from /Users/admin/Desktop/sample_app/spec/factories.rb:4:in `<top (required)>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/factory_girl-4.1.0/lib/factory_girl/find_definitions.rb:16:in `block in find_definitions'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/factory_girl-4.1.0/lib/factory_girl/find_definitions.rb:15:in `each'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/factory_girl-4.1.0/lib/factory_girl/find_definitions.rb:15:in `find_definitions'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/factory_girl_rails-4.1.0/lib/factory_girl_rails/railtie.rb:26:in `block in <class:Railtie>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:34:in `call'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.11/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/admin/Desktop/sample_app/config/environment.rb:5:in `<top (required)>'
    from /Users/admin/Desktop/sample_app/spec/spec_helper.rb:8:in `require'
    from /Users/admin/Desktop/sample_app/spec/spec_helper.rb:8:in `block in <top (required)>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
    from /Users/admin/Desktop/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
    from /Users/admin/Desktop/sample_app/spec/requests/users_spec.rb:1:in `require'
    from /Users/admin/Desktop/sample_app/spec/requests/users_spec.rb:1:in `<top (required)>'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:77:in `rescue in run'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:73:in `run'
    from /Users/admin/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'

this is factories.rb:

# By using the symbol ':user', we get Factory Girl to simulate the User model.
# we can create a User factory in the tests like this:
# @user = Factory(:user)
FactoryGirl.define :user do |user|
    user.name "Pavan Katepalli"
    user.email "email@pavan.com"
    user.password "foobar"
    user.password_confirmation "foobar"
end

this is users_spec:

require 'spec_helper'
require 'factory_girl_rails'

describe "Users" do

  describe "signup" do

        describe "failure" do
            it "should not make a new user" do
                lambda do
                    visit signup_path
                    fill_in "Name",         :with => ""
                    fill_in "Email",        :with => ""
                    fill_in "Password",     :with => ""
                    fill_in "Confirmation", :with => ""
                    click_button
                    response.should render_template('users/new')
                    response.should have_selector('div#error_explanation')
                end.should_not change(User, :count)
            end
        end

        describe "success" do
      it "should make a new user" do
        lambda do
          visit signup_path
          fill_in "Name",         :with => "Example User"
          fill_in "Email",        :with => "user@example.com"
          fill_in "Password",     :with => "foobar"
          fill_in "Confirmation", :with => "foobar"
          click_button
          response.should have_selector('div.flash.success',
                                        :content => "Welcome")
          response.should render_template('users/show')
        end.should change(User, :count).by(1)
      end
    end


    end

end

this is users_controller_spec.rb:

require 'spec_helper'
require 'factory_girl_rails'

describe UsersController do

    render_views

    describe "GET 'show'" do

        before(:each) do
          @user = FactoryGirl(:user)
        end

        it "should be successful" do
          get :show, :id => @user.id
          response.should be_success
        end

        it "should find the right user" do
          get :show, :id => @user.id

          # assigns(:user) returns the 
          # value of the instance variable @user
          assigns(:user).should == @user
        end

        it "should have the right title" do
          get :show, :id => @user.id
          response.should have_selector('title', :content => @user.name)
        end

        it "should have the user's name" do
          get :show, :id => @user.id
          response.should have_selector('h1', :content => @user.name)
        end

        it "should have a profile image" do
          get :show, :id => @user.id
          response.should have_selector('h1>img', :class => "gravatar")
        end
    end

    describe "GET 'new'" do

        it "should be successful" do
          get :new
          response.should be_success
        end

        it "should have the right title" do
          get :new
          response.should have_selector('title', :content => "Sign up")
        end
    end

    describe "POST 'create'" do

        describe "failure" do

            before(:each) do
                @attr = { :name => "", :email => "", :password => "",
                      :password_confirmation => "" }
            end

            it "should not create a user" do
                lambda do
                    post :create, :user => @attr
                end.should_not change(User, :count)
            end

            it "should have the right title" do
                post :create, :user => @attr
                response.should have_selector('title', :content => "Sign up")
            end

            it "should render the 'new' page" do
                post :create, :user => @attr
                response.should render_template('new')
            end
        end

        describe "success" do

            before(:each) do
                @attr = { :name => "New User", :email => "user@example.com",
                      :password => "foobar", :password_confirmation => "foobar" }
            end

            it "should create a user" do
                lambda do
                    post :create, :user => @attr
                end.should change(User, :count).by(1)
            end

            it "should redirect to the user show page" do
                post :create, :user => @attr
                response.should redirect_to(user_path(assigns(:user)))
            end

            it "should have a welcome message" do
                post :create, :user => @attr
                flash[:success].should =~ /welcome to the sample app/i
            end

        end
    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-06-17T14:54:28+00:00Added an answer on June 17, 2026 at 2:54 pm

    The repo you linked is pretty old (the last commit to the spec folder was 2 years ago), and you’ve likely got newer versions of the gems (including FactoryGirl) that that uses installed.

    Now what you can do is prefix your rspec call with bundle exec, this will run rspec in the context of the gems in your current bundle:

    bundle exec rspec spec/requests/users_spec.rb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run: bundle exec rspec spec/requests/static_pages_spec.rb : I get: c:\Sites\sample_app>bundle exec rspec spec/requests/static_pages_spec.rb
Ruby 1.9.2, RoR 3.0.1. When I run 'rspec spec' I get this error. Can't
I run: $ bundle exec rspec spec/ And receive this message: C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core.rb:78:in `require': no
When I run rspec spec I get the following: /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions/active_record/base.rb:26:in `': uninitialized constant ActiveModel
When I run $ rspec spec/ I receive this error: You must use ANSICON
I'm using: Rails 3.0.7 and Rspec 2.5.0 via rvm When I run this spec
Running this (bundle exec rspec spec/requests/static_pages_spec.rb) worked fine yesterday, but today when I go
I am new to using RSpec. when I run rake spec, I get a
I'm getting the following error when I try to run an rspec test: /srv/offerme/spec/requests/static_pages_spec.rb:13:
I'm following the rails tutorial here: http://railstutorial.org/chapters/filling-in-the-layout#top When I run rspec spec/, I get

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.