Category Archives: RSpec

Quick testing of ActiveRecord validations in RSpec

ActiveRecord’s validations are a convenient way to test and control the state of objects before they hit the database.
Validations are themselves a presumably well-tested part of Ruby on Rails, but their usage in an application significantly changes the behaviour of your objects.
This means they should be spec’d like anything else.
Spec’ing out every single attribute on […]

Why I am switching to test-driven development

I am going to change the way I code.
My working pattern is, roughly, as follows:

Sketch a basic method implementation
Test it manually
Fine tune the code, improve implementation
Further manual testing, fix a few bugs
Write a test
Done! Make a cup of coffee.

Is there anything so bad about this process? I write a test, so I get one […]