How We Test Rails
Applications
Damian Galarza
Developer at thoughtbot
@dgalarza
RSpec
Outside In Testing
Feature specs
Feature Specs
Slow
Feature Specs
spec/features
Feature Specs
ROLE_ACTION_spec.rb
Feature Specs
patient_checks_in_for_appointment_spec.rb
Feature Specs
Model specs
Model Specs
Fast
Model Specs
Test smaller parts
Model Specs
Model Specs
Model Specs
Model Specs
Controller specs
Controller Specs
Test multiple paths
Controller Specs
Don’t duplicate tests from
features
Controller Specs
View specs
View Specs
Conditional View Logic
View Specs
Test doubles and stubs
Test doubles and stubs
Test doubles and stubs
Test spies
Test spies
Validate a message is
received
Test spies
Questions?