Skip to content

Commit 641ebbb

Browse files
committed
Explain how to set a default driver for system specs
1 parent ab36146 commit 641ebbb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

features/system_specs/system_specs.feature

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ Feature: System specs
1919

2020
RSpec **does not** use your `ApplicationSystemTestCase` helper. Instead it
2121
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.
22+
this behaviour you can call `driven_by` manually in a test. Alternatively,
23+
if you want to specify a default driver for all system specs (rather than
24+
using `driven_by` in every spec), add the following to `spec/rails_helper.rb`:
25+
26+
```
27+
config.before(type: :system) do
28+
driven_by :selenium_headless # Or your preferred default driver
29+
end
30+
```
2331

2432
System specs run in a transaction. So unlike feature specs with
2533
javascript, you do not need [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner).

0 commit comments

Comments
 (0)