Is there a difference between a feature spec and system spec? Both seem to use Capybara to test the full application yet they have different docs on RSpec.
Difference between feature spec and system spec
Asked Answered
System specs are built on top of Rails own system tests while feature specs were implemented by RSpec before Rails had system tests. If you're starting a new project write system specs, but if you have existing feature specs there's really nothing to be gained currently by changing them to system specs since functionality wise they're basically identical.
Curious why RSpec hasn't deprecated featured specs –
Owenowena
Also found in official documentation: relishapp.com/rspec/rspec-rails/docs/system-specs/system-spec "System specs run in a transaction. So unlike feature specs with javascript, you do not need DatabaseCleaner." –
Shanell
@Shanell As long as you’re using Rails 5.1+ you can use the shared DB connection and transaction support on either feature or system specs –
Dominoes
© 2022 - 2024 — McMap. All rights reserved.