In this tutorial, we will cover how to test Ruby on Rails models with the Minitest testing suite. After completing this tutorial, you will have learned the following:
We will be using Ruby 2.3, Rails 5.0 and Minitest 5.8. However, older versions should have the same behavior. The only difference to note is that models in Rails 5.0 inherit fromApplicationRecord
instead of ActiveRecord::Base
.