Posted about 3 years ago. Visible to the public.

RSpec in depth

Reading

Work through the following chapters from Everyday Rails Testing with RSpec (in our library), if you haven't read them yet:

  • Model specs
  • Generating test data with factories
  • Basic controller specs (we don't often write them, but sometimes they are useful)
  • Speeding up specs
  • Testing the rest

Also read through the documentation of both factory_bot (formerly known as factory_girl) and Machinist 1. These are the gems you will encounter for test data generation in our projects.

RSpec matchers

Get an overview of all the matchers that are build into RSpec:

Play with every other matcher in your MovieDB tests.

Write two custom matchers and use them in your MovieDB tests.

More RSpec features

Understand the following RSpec features. Try to use them in MovieDB where possible.

rspec_candy

A lot of our projects require rspec_candy.

This is a collection of tools and helpers for RSpec test suites.

Get an overview of what rspec_candy can do. Note how some of its features are now part of modern RSpec versions!

Shoulda matchers

Many of our projects use Shoulda Matchers.

Find out what it does.

Add specs for some validations in your MovieDB.

Owner of this card:

Avatar
Henning Koch
Last edit:
6 months ago
by Florian Leinsinger
Posted by Henning Koch to makandra Curriculum
This website uses cookies to improve usability and analyze traffic.
Accept or learn more