System Specs
Background
"System tests" are the new replacement for "feature specs" in modern Rails apps. Also, the new driver Ferrum-Cuprite driver does a similar job to Selenium, but it's radically faster and the tests are way more stable (less flaky specs). See also relevant thread on Slack.
Migration from Feature specs into System specs
This is a task which is in progress here. The process involves these steps (mentioned on this page) :
- move spec files from spec/features to into spec/system
- replace
require "spec_helper"
withrequire "system_helper"
- Use
RSpec.describe
to define system specs, instead ofRSpec.feature
- Replace the
scenario
alias in previous feature specs with the standardit
syntax (this appears to be optional)
Additionally, other changes may be required. For example:
- some helper methods were created considered Selenium; these won't work now and need to be adapted to Ferrum
- some syntax might not work under system specs, for example
background do
blocks need to be replaced withbefore do
. - other issues will certainly come up and will be added here
References