Fast, Sexy, and Svelte: Our Kind of Rails Testing

Get Started. It's Free
or sign up with your email address
Fast, Sexy, and Svelte: Our Kind of Rails Testing by Mind Map: Fast, Sexy, and Svelte: Our Kind of Rails Testing

1. speakers

1.1. Dan Manges (ThoughtWorks)

1.2. Zak Tamsen (ThoughtWorks)

2. spectrum

2.1. unit

2.1.1. what is? finegrained and focus one object at a time fast!!

2.1.2. avoid unit test brittleness activerecord test -> hit the database remove db from the equation gem install unit_record ActiveRecord::Base.disconnect!

2.1.3. unit test are for any class (not only models) controllers using mocks to avoid dependencies of the model gem install unit_controller views brittle! don't do it in the view shouldnt be interesting logic

2.1.4. new way unit test for any class no fixtures not hitting the db

2.2. functional

2.2.1. less fine grained

2.2.2. still fast

2.2.3. hits the db test sql

2.2.4. requires data problems with fixtures pain maintaining arbirtrary use by different devs model factory (Factory Method Pattern)

2.2.5. for any class models interaction between controller and view

2.2.6. speed slower in parallel faster (33%) deepTest

2.3. integration

2.3.1. classic integration tests

2.3.2. sometimes useful for special purpose tests performance tests smoke tests tests simulating multiple users

2.4. --denial--

2.5. acceptance

2.5.1. coarse grained test

2.5.2. selenium

2.5.3. very slow!

2.5.4. writting acceptance tests encapsulating a page

2.5.5. acceptance test

2.5.6. data access focused acceptance test hacking cookies to avoid login page

2.5.7. acceptance test parallelization