Replacing system tests with unit tests | Everyday Rails
14-Jun-2024 509
It’s amusing and affirming to me that system testing (in Rails) has been declared a failure. I could’ve told you that years ago! I’ve spent much of the past ten years working with test suites that are slow, brittle, and ultimately uninformative—almost always because they’re overly reliant on testing end-to-end.This article isn’t to say I told you so, though. Much of the pain I’ve felt from too many system tests was self-inflicted—either because I wrote the test myself, or because I suggested to someone else that they give it a try. So it’s one thing for me to tell you to reduce or replace your system tests with smaller ones—in this article, I’ll also give you some general guidance on how to do it. This advice comes from experience with Ruby on Rails, but if you’re using other languages or frameworks, and you’re clever, I bet it’s at least a little applicable to your situation.
Replacing system tests with unit tests | Everyday Rails #ruby #rubydeveloper #rubyonrails #Replacing #system #tests #tests #Everyday #Rails #tests https://rubyonrails.ba/link/replacing-system-tests-with-unit-tests-everyday-rails