I’m trying to add some more tests to my application and was wondering
what’s the best way to test all my routes/views of my application. I’m
using HAML which can lead to some typos since I’m new to it and of
course the Ruby code itself in the views.
How would you test the views? Does it make sense to somehow extract all
routes and “surf” on every possible route to check if it’s a 200 or not?
On Fri, 2010-09-17 at 09:28 +0200, Zoran Szagaski wrote:
Hey,
I’m trying to add some more tests to my application and was wondering
what’s the best way to test all my routes/views of my application. I’m
using HAML which can lead to some typos since I’m new to it and of
course the Ruby code itself in the views.
How would you test the views? Does it make sense to somehow extract all
routes and “surf” on every possible route to check if it’s a 200 or not?
I would recommend building up a set of integration tests using Cucumber
or similar: http://cukes.info/. This will allow you to check that all
the “moving parts” of your applications are working together correctly,
including that your routes/redirections/views are free from errors. You
can find a list of tutorials here: http://wiki.github.com/aslakhellesoy/cucumber/tutorials-and-related-blog-posts
I would recommend building up a set of integration tests using Cucumber
or similar: http://cukes.info/. This will allow you to check that all
the “moving parts” of your applications are working together correctly,
including that your routes/redirections/views are free from errors. You
can find a list of tutorials here: http://wiki.github.com/aslakhellesoy/cucumber/tutorials-and-related-blog-posts
An alternative, or more likely in combination with cucumber stories,
RSSpec provides routing expectations: