Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
tmp
vendor
.gitignore
.rspec
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package.json

README.md

Test Driven RSpec - Episode 04, Unit Testing Models

Watch the screencast on YouTube.

The completed code from Episode 04. This episode covers writing unit tests for a Rails model.

This episode covers:

  • Creating a Console model
  • Testing model validations
  • Testing model methods
  • Testing model scopes
  • Refactoring the consoles array of hashes into database queries

Install the dependencies bundle install and run the specs with bin/rspec.

Software used:

  • Ruby 2.4.2
  • Rails 5.1.4
  • RSpec 3.6.1
  • Mac OS
  • iTerm 2
  • Vim
  • Tmux
You can’t perform that action at this time.