how we test rails apps

31
How We Test Rails Applications

Upload: damian-galarza

Post on 18-Jul-2015

51 views

Category:

Software


2 download

TRANSCRIPT

How We Test Rails Applications

Damian GalarzaDeveloper 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?