|
1 | 1 | Feature: System spec
|
2 | 2 |
|
3 | 3 | System specs are RSpec's wrapper around Rails' own
|
4 |
| - [system tests](http://guides.rubyonrails.org/testing.html#system-testing). |
5 |
| - We encourage you to familiarize yourself with their documentation. |
| 4 | + [system tests](https://guides.rubyonrails.org/testing.html#system-testing). |
6 | 5 |
|
7 |
| - RSpec **does not** use your `ApplicationSystemTestCase` helper. Instead it uses |
8 |
| - the default `driven_by(:selenium)` from Rails. If you want to override this |
9 |
| - behaviour you can call `driven_by` manually in a test. |
| 6 | + > System tests allow you to test user interactions with your application, |
| 7 | + > running tests in either a real or a headless browser. System tests use |
| 8 | + > Capybara under the hood. |
| 9 | + > |
| 10 | + > By default, system tests are run with the Selenium driver, using the |
| 11 | + > Chrome browser, and a screen size of 1400x1400. The next section explains |
| 12 | + > how to change the default settings. |
10 | 13 |
|
| 14 | + System specs are marked by setting type to :system, e.g. `:type => :system`. |
| 15 | + |
| 16 | + The Capybara gem is automatically required, and Rails includes it in |
| 17 | + generated application Gemfiles. Configure a webserver (e.g. |
| 18 | + `Capybara.server = :webrick`) before attempting to use system specs. |
| 19 | + |
| 20 | + RSpec **does not** use your `ApplicationSystemTestCase` helper. Instead it |
| 21 | + uses the default `driven_by(:selenium)` from Rails. If you want to override |
| 22 | + this behaviour you can call `driven_by` manually in a test. |
| 23 | + |
| 24 | + System specs run in a transaction. So unlike feature specs with |
| 25 | + javascript, you do not need [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner). |
11 | 26 |
|
12 | 27 | @system_test
|
13 | 28 | Scenario: System specs
|
|
0 commit comments