0

I am using the mentioned configuration and created feature in folder spec/features But I am still getting visit undefined method error. Here is the code.

require 'spec_helper'
describe 'view list of movies' do
  it 'shows movie list' do
     visit 'http://localhost:3000/movies'
     expect(page).to have_text('2 movies')
  end
end

This results in following error.

  undefined method `visit' for #<RSpec::ExampleGroups:view list of movies:

Any suggestions appreciated. I created this question as I tried all the possible solutions mentioned in those 4 questions but none of them worked.

user633
  • 3
  • 3

1 Answers1

0

In your rails_helper.rb :

require 'rspec/rails'
require 'capybara/rails'

In your feature add:

require 'rails_helper'

include Warden::Test::Helpers
Warden.test_mode!
RedZagogulin
  • 441
  • 3
  • 11
  • Thanks. This worked in mac osx. But it is not working in windows 7. Also I did not include include Warden::Test::Helpers Warden.test_mode! – user633 Aug 03 '14 at 00:05