Posts tagged spec

Dec14

Testing JSON/XML responses in Rails

rails test spec | comments

Recently I had to find out how to test the output of a rails controller when the json format is specified. I’m using rspec by the way, but this should work in other frameworks as well.

My instinct, which was wrong, was to do what we do all over the rest of rails:

Continue reading »

Oct30

RSpec and RR troubles

rspec rr | comments

Update: This has to do with Rails and not RSpec or RR

The road to TDD is a dangerous one.

I spent two hours diagnosing an issue that was simple to fix, but a devil to hunt down.

I am using RSpec with RR on a project, and noticed that when I ran my specs with autospec or rake, I had failing tests, but when I ran them individually with spec or textmate, everything was fine.

Continue reading »

Oct23

Testing Authlogic with Factory Girl

rails rspec authlogic factory_girl | comments

There’s an interesting gotcha about testing Authlogic with factory_girl that I just ran into and spent a half hour trying to figure it out.

Continue reading »