Skip to content

Explain how to set a default driver for system specs #2807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion features/system_specs/system_specs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ Feature: System specs

RSpec **does not** use your `ApplicationSystemTestCase` helper. Instead it
uses the default `driven_by(:selenium)` from Rails. If you want to override
this behaviour you can call `driven_by` manually in a test.
this behaviour you can call `driven_by` manually in a test. Alternatively,
if you want to specify a default driver for all system specs (rather than
using `driven_by` in every spec), add the following to `spec/rails_helper.rb`:

```
config.before(type: :system) do
driven_by :selenium_headless # Or your preferred default driver
end
```

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