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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:54:05+00:00 2026-06-05T15:54:05+00:00

I met strange problem. I have never work with Devise gem before. So, i

  • 0

I met strange problem. I have never work with Devise gem before. So, i try to write simple RSpec test:

require 'spec_helper'

describe "Admins" do
  before(:each) do
    @email = "test@test.ru"
    user = FactoryGirl.create(:user, :email => @email )
  end

  describe "sign in/out" do
    describe "success" do
      it "should sign a user in and out" do
        visit new_user_session_path
      end
    end
  end
end

And i receive such error:

  1) Admins sign in/out success should sign a user in and out
     Failure/Error: visit new_user_session_path
     NoMethodError:
       undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1:0x007fb2b7e393d0>
     # ./spec/requests/admins_spec.rb:12:in `block (4 levels) in <top (required)>'

Finished in 0.05646 seconds

My Factory:

FactoryGirl.define do
  factory :user do |user|
    user.admin true
    user.password "qwerty"
    user.sequence(:email) { |n| "user#{n}@user.com" }
  end
end

Routes:

        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
           user_password POST   /users/password(.:format)      devise/passwords#create
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                         PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
       user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy
  • 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-05T15:54:06+00:00Added an answer on June 5, 2026 at 3:54 pm

    visit is capybara method, not Rspec. You have to add capybara gem to your Gemfile, run bundle, and require 'capybara/rspec' in spec_helper, just like ArcaneRain pointed out.

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

Sidebar

Related Questions

I met very strange problem. I have Timetable model and try to write my
I have met a strange problem with the localized strings. I have only a
I am starting to learn Play Framework 2, and have met a strange problem.
In my customized function I met a strange problem. I'm writing a function to
I met a problem which is very strange, my company uses Visual Source Safe
I met a strange error after migration to XTEXT2. When I write three elements,
I use sphinx + thinking_sphinx on my local machine and met really strange problem.
Recently I met a strange problem, see code snips as below: var sqlCommand: string;
I met strange difficulty developing one project. I dont have enough experience with classes
I've met with strange issue in Selenium RC. When I use IE7 the test

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.