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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:31:34+00:00 2026-06-17T09:31:34+00:00

I cannot get capybara to work. I am using capybara 2.0.0 I get this

  • 0

I cannot get capybara to work. I am using capybara 2.0.0

I get this error

Failure/Error: visit "/users/sign_in"
     NoMethodError:
       undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_21:0x007fdda4c6eba0>

on this spec

spec/requests/forgot_password_spec.rb

describe "forgot password" do
  it "redirects user to users firms subdomain" do
    visit "/users/sign_in"  
  end
end

I do not get any errors that it cannot find capybara and it’s included in the spec_helper.rb

spec_helper.rb

require 'rubygems'
require 'spork'
require 'database_cleaner'
Spork.prefork do
 ENV["RAILS_ENV"] ||= 'test'
 require File.expand_path("../../config/environment", __FILE__)
 require 'rspec/rails' 
 require 'capybara/rspec'
 require 'rspec/autorun'
 require 'factory_girl'


 Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

 RSpec.configure do |config|
   config.include Devise::TestHelpers, :type => :controller
   config.extend ControllerMacros, :type => :controller
   config.include RequestMacros, :type => :request
   config.mock_with :rspec

   config.use_transactional_fixtures = false

   config.before(:suite) do
     DatabaseCleaner.strategy = :truncation
   end

   config.before(:each) do
     DatabaseCleaner.start
   end

   config.after(:each) do
     DatabaseCleaner.clean
   end
   config.infer_base_class_for_anonymous_controllers = false
 end
 Spork.each_run do
   FactoryGirl.reload  
 end
 end

Has anybody else encountered this?

  • 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-17T09:31:34+00:00Added an answer on June 17, 2026 at 9:31 am

    If you’ve got version >= 2.0, any tests that use Capybara methods like visit should go under a spec/features directory, and not under spec/requests, where they’d normally reside in Capybara 1.1.2.

    Have a look at the following links for more information:

    • rspec-rails and capybara 2.0: what you need to know
    • rspec-rails gem Capybara page

    If you don’t want to use a spec/features directory, you should be able to mark a test as a feature in the following way and have Capybara methods work:

    describe "Some action", type: :feature do
      before do
        visit "/users/sign_in"
        # ...
      end
      # ...
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Cannot get this to work. First time using variables passed into functions. Unchecking radio
I cannot get parse to work with rubymotion. I tried using the cocoapod and
I cannot get this to work. I have opened a SQL Server Express table
I cannot get the pager to work for my ListUsers page. The method in
I cannot get word-wrap to work with this example... <html> <head></head> <body> <table style=table-layout:fixed;>
I cannot get this to work: var global_variables = { players: [] }; var
I cannot get this to work. I have a MemoryStream object. This class has
I cannot get this to work. I want to use str_to_date to convert a
I cannot get to the bottom of this error because it happens only in
I cannot get this modal dialog to work property. Problem is that in a

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.