What are the different kinds of Rails tests and when should I use each? - Code with Jason
07-Nov-2020 1197
The eight types of RSpec specsThe RSpec library offers a lot of different spec types.Model specsSystem specs/feature specs*Request specs/controller specs*Helper specsView specsRouting specsMailer specsJob specsThere are two lines with asterisks. These are cases where the RSpec team decreed one spec type obsolete and replaced it with a new type. I’m only including those ones for completeness.So the up-to-date list is really the following.Model specsSystem specsRequest specsHelper specsView specsRouting specsMailer specsJob specsHere’s when I use each.Model specs – alwaysSystem specs – alwaysRequest specs – rarelyHelper specs – rarelyView specs – neverRouting specs – neverMailer specs – neverJob specs – neverLet’s talk about each of these spec types in detail. I’ll explain why I use the ones I use and why I ignore the ones I ignore.
What are the different kinds of Rails tests and when should I use each? - Code with Jason #ruby #rubydeveloper #rubyonrails #different #kinds #Rails #tests #should #each? #Jason #code #tests https://rubyonrails.ba/link/what-are-the-different-kinds-of-rails-tests-and-when-should-i-use-each-code-with-jason