Testing 101
Ombu Labs, February 2015
Rule #1: If you break the build, fix it.
Every pull request has a build
Rule #2: If you fix a bug, add a test.
RSpec path/to/project/spec/*
Integration project/spec/requests/*
Services (Unit testing) project/spec/services/*
Models (Unit testing) project/spec/models/*
Cucumber path/to/project/features/*
cucumberBecause we don’t use it anymore…
Rule #3: If you add a feature, add a test.
What is the possible input/output of your code?
Test the boundary input parameters for your code
Test the different paths of your code
Apply TDD if it helps you understand the problem
Code defensively, test creatively
How could someone break your code?
Treat your methods like a black box