11 January 2007

Integration Testing Rails

After reading Jamis’s excellent blog about integration testing a ruby on rails app, I decided to take the plunge and write my first integration test. I have never cared much for testing, but with the wonderful testing architecture set up in rails, I have started to actually enjoy it. I now write many tests before I finish coding anything else. I have found it to be very useful and I suspect it has saved me a lot of debugging time. I was kind of forced into this recently because there was no way to test my most recent code with a browser for our iMemoryBook product. The only way I could actually see if what I was writing worked at all was to write a series of functional tests. Today, though, I found I needed to test how two controllers worked together. Hence my need for learning about integration tests.

Duane had written one integration test already so I had a good example to go by, but there was one thing that I did not know how to do. This is why I am writing now, to share what I learned.

No comments: