SpeedUp Rspec tests



Couple tips how to speed up you'r tests!

1. Shared examples (it_behaves_like)

Can be written:

2. Custom matchers

Should be
If you have a lot of equal custom matchers - move it to matchers.

3. Associations in factory
If you have a lot associations in model, avoid using it always.


4. Transictions

let! method will create instance for each test.
Try use  let_it_be for creating only one. (like before :all)


http://pdabrowski.com

Comments