RSpec

RSpec Best Practices

Nov 5, 2013

I’ve been using RSpec on and off for the past 2 years. I’ve learnt that it’s easy to write tests that are bloated, slow and don’t offer any value. I’ve also learnt a few tricks and best practices that will make your RSpec life a bit easier.

Read More →

Testing ActiveRecord Callbacks

Oct 31, 2013

I’m not a big fan of ActiveRecord callbacks – it usually seems like a quick-and-easy solution, but in the long term it makes testing difficult and can often create unexpected side-effects. However, sometimes there really is no other option which means we need to test these callbacks!

Read More →

How much duplication should we tolerate in tests?

Nov 16, 2012

As a developer I’m used to avoiding duplication in code. Avoiding duplication is even listed as one of the 4 rules of the TDD cycle:

Read More →