Difference between feature spec and system spec
Asked Answered
O

1

16

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.

Owenowena answered 18/4, 2018 at 22:37 Comment(0)
D
25

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.

Dominoes answered 18/4, 2018 at 23:16 Comment(3)
Curious why RSpec hasn't deprecated featured specsOwenowena
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 specsDominoes

© 2022 - 2024 — McMap. All rights reserved.