What are the different kinds of Rails tests and when should I use each? - Code with Jason

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 #code #tests https://rubyonrails.ba/single/what-are-the-different-kinds-of-rails-tests-and-when-should-i-use-each-code-with-jason

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles