An in-depth look at unit testing Rails models with RSpec with TDD.
Support my screencasts by buying me a coffee: https://www.buymeacoffee.com/brettcha...
This episode covers:
00:00 - Intro
00:45 - Creating a Console model
03:28 - Testing model validations
12:17 - Testing model methods
15:12 - Testing model scopes
20:12 - Refactoring the consoles array of hashes into database queries
Code from the episode: https://github.com/brettchalupa/test-...
Episode blog post: https://code.brettchalupa.com/test-dr...
You can purchase the series to view it offline: https://gumroad.com/l/test-driven-rspec
Software used:
Ruby 2.4.2
RSpec 3.6.1
Rails 5.1.4
Mac OS
iTerm 2
Vim
Tmux
Let me know if you run into any issues or have any specific topics you'd like covered.
Follow along online:
Website: https://code.brettchalupa.com/
Twitter: / brettchalupa