- Capybara 2.0 annotation
- Capybara 2.0 update guide
- Tips to clean up capybara specs
- What you need to know about capybara 2.0
- Blogpost from jose valim
- Abandon confusion about rack-test DSL (get, post, update, assert on request) and capybara DSL (visit, assert on page).
- Clarify where to place tests and how to write them.
- spec/requests is now meant to test things like an http request. Capybara is not supported any more here. Only rack-test is supported here.
- spec/features is new and should contain browser based tests from the users point of view. It does not have rack-test dsl but capybara DSL loaded.
- spec/api has only rack-test DSL loaded.
- Ambiguous elements raise an error now. The search term must be exact
- has_content? now reflects css rule text-transform: uppercase. see here. Rack-test still does not reflect this.
- has_content? matches only visible elements
- page dies not match for elements within . use page.body.should have_selector "head title" to test page title.
bundle update capybara capybara-webkit capybara-email rspec-rails
Take a look at spec/acceptance. All the tests that use capybara should move to spec/features.
Define the searchterms for elements exactly because ambiguous elements will raise.