Posts for category: links
Take Two And Call Me In The Morning: Links for Jan 19
Some test-related Rails links for you to chew on:
Pat Maddox on testing controllers. Key quote:
Controller specs don’t matter, because controllers don’t matter
In other words, all your complicated code should be in the model or in a mini-framework like James Golick’s resource_controller. If that’s true, then your controller tests become similar to integration tests.
The post has some nice examples of using Cucumber for controller testing—what I’ve called skeleton controller tests in other contexts.
Speaking of James Golick, he has a new tool called Zebra, which integrates with Context or Shoulda to add easy to write one line assertion tests inside a context: expect { @post.to be_editable_by(@author) }.
So far, I haven’t been the biggest advocate of the one-assertion-per-test style, but this syntax is nice, and I think I’ll be trying this out as soon as I can.
Meantime Stephen Boisvert was kind enough to link to the Patfinder cross-post of my interview with myself, saying:
Strangely light on depth and details given the interviewer’s relationship to the interviewee
It’s funny because it’s true! More details coming on the blog and the testing book. Also, thanks for saying nice things about my book—always nice to hear.
Testing Month on Rails Tips
I’d be remiss if I didn’t mention that RailsTips has declared “Test Awareness Month”, a moth of posting about tests, starting with Test Or Die. Looking forward to it!


