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.
Asked
Active
Viewed 2,781 times
1 Answers
24
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.

Thomas Walpole
- 48,548
- 5
- 64
- 78
-
3Curious why RSpec hasn't deprecated featured specs – Ben G Apr 19 '18 at 03:17
-
2Also found in official documentation: https://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." – woto Jun 28 '20 at 07:57
-
3@woto 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 – Thomas Walpole Jun 28 '20 at 12:37