Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Problems with using Capybara #51

Open
vdogamer opened this issue Feb 24, 2015 · 4 comments
Open

Problems with using Capybara #51

vdogamer opened this issue Feb 24, 2015 · 4 comments

Comments

@vdogamer
Copy link

Hello.

First I want to say "Thank you!!!" for creating this book!!! I will recommend this book for the Thinkful.com training site. I'm having problems with the Capybara testing. Rspec doesn't like when I type 'visit root_path'. When I create the Module, it still doesn't like the login aspect.

my github is https://github.com/vdogamer/rpsec1
(forgive my misspelling)

@ruralocity
Copy link
Member

Hi, glad you liked the book! Try adding the following near the top of your rails_helper.rb file:

require 'capybara/rails'

@vdogamer
Copy link
Author

Hello, Aaron.

I still get a “NoMethodError: undefined method for ‘sign_in’” error for the User Management feature spec.

Cameron.

From: Aaron Sumner [mailto:[email protected]]
Sent: Monday, February 23, 2015 9:12 PM
To: everydayrails/rails-4-1-rspec-3-0
Cc: Cameron Diggs
Subject: Re: [rails-4-1-rspec-3-0] Problems with using Capybara (#51)

Hi, glad you liked the book! Try adding the following near the top of your rails_helper.rb file:

require 'capybara/rails'


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-75685814.

@ruralocity
Copy link
Member

I don't see the following in rails_helper.rb:

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

RSpec.configure do |config|
  # other RSpec configuration omitted ...
  config.include LoginMacros
end

This is covered in chapter 7. RSpec needs to know where to load any support files.

@vdogamer
Copy link
Author

Ah! Okay.

I did skip that chapter because I wanted to jump into Capybara.
Thanks again for the quick response!!!

Cameron.

From: Aaron Sumner [mailto:[email protected]]
Sent: Tuesday, February 24, 2015 9:20 PM
To: everydayrails/rails-4-1-rspec-3-0
Cc: Cameron Diggs
Subject: Re: [rails-4-1-rspec-3-0] Problems with using Capybara (#51)

I don't see the following in rails_helper.rb:

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

RSpec.configure do |config|

other RSpec configuration omitted ...

config.include LoginMacros

end

This is covered in chapter 7. RSpec needs to know where to load any support files.


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-75893360.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants