Created by: seanpdoyle
Migrate from the rspec-rails
-provided Feature Tests, to the
Rails-provided System Tests.
The most beneficial outcome of this migration is the ability to rely on
use_transactional_fixtures = true
in
browser-driven (JavaScript-enabled).
In order to be System Test compatible, this commit replaces test block
declarations made with feature
with RSpec.describe
, along with calls
to scenario
with it
.
In order to continue to support rails@4.2
and rails@5.0
, the test
harness must elect to run type: :feature
tests when
[ActionDispatch::SystemTestCase
][system-test-care] is not declared.
In those cases, to preserve compatibility:
- pass
type: :feature
instead oftype: :system
to tests declared inspec/system
- require
database_cleaner
gem, along with Feature-test compatible configuration
To achieve this, this commit introduces the SYSTEM_TEST
constant,
which refers to the correct type:
option: :feature
for older
versions of Rails, :system
for newer versions.
Once support for rails@4.2
and rails@5.0
is dropped, these
declarations can be removed, and type: SYSTEM_TEST
options can be
search-and-replaced with type: :system
.