Writing code without testing can be a deceptively smooth ride; one that, unfortunately, comes to a screeching halt when you start working with other developers. This tutorial is aimed at helping Ruby on Rails developers (especially the new folks) in setting up an RSpec test suite using best practices, in the Behaviour Driven Development way. I know that testing can be pain when you are just getting into it. There are lots of resources online to help you on this journey. I am hopeful this will be of benefit to new Ruby on Rails developers since I just started getting into testing myself.
In this tutorial we will learn the following:
* How to setup - RSpec, Capybara, Shoulda-Matchers, Database Cleaner
* How to create a factory using Factory Girl Rails and Faker
* How to write Model Specs
* How to write Controller Specs
* How to write Feature Specs
* How to check spec coverage using SimpleCov
Continue reading %Learn the First Best Practices for Rails and RSpec%
by Kingsley Silas via SitePoint
No comments:
Post a Comment