File: Capybara.md

package info (click to toggle)
ruby-rspec-rails 8.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: ruby: 10,881; sh: 198; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
rspec-rails supports integration with Capybara out of the box by adding
its Capybara::DSL (visit/page) and Capybara::RSpecMatchers to the
examples in the applicable directories.

## Capybara::DSL

Adds the `visit` and `page` methods, which work together to simulate a
GET request and provide access to the result (via `page`).

Capybara::DSL is added to examples in:

* spec/features

## Capybara::RSpecMatchers

Exposes matchers used to specify expected HTML content (e.g. `should_not have_selector` will work correctly).

Capybara::RSpecMatchers is added to examples in:

* spec/features
* spec/controllers
* spec/views
* spec/helpers
* spec/mailers

## Upgrading to Capybara-3.x

Consult the official [Upgrading from Capybara 2.x to 3.x](https://github.com/teamcapybara/capybara/blob/master/UPGRADING.md#upgrading-from-capybara-2x-to-3x) guide.