Integration test with RSpec and Capybara
Generally we use controller spec, model spec to test our application. What if when you will needs to put everything together? Feature spec is nothing but integration testing.
Feature spec makes sure that models and controllers all workes nicely with other models and controllers in the application.
Capybara 2.x introduced a few changes with some advanced use. So it’s becomes the term feature instead of request.
If you are upgrading to Capybara 2.0, you’ll need to do a few things:
- Upgrade rspec-rails to 2.12.0 or greater
- Move all the tests from spec/request to spec/features
group :test do gem "rspec-rails", "~> 2.12.2" gem "capybara", "~> 2.0" end
Capybara lets you know about how a user would interact with your application…
View original post 133 more words