[rspec-users] How thorough do you test?

Chris Olsen lists at ruby-forum.com
Wed Nov 21 13:22:51 EST 2007


Testing models is great and would not be able to create anything without
it, but I am finding testing the controllers and views is a pain.

Rest based controllers don't seem to change that much when compared to
the auto-generated code that obviously works.

As for views I fail to see why testing it with a mock model does
anything.  Nothing is ensuring that when changes are made to the model
that they will also be done to the mocks then causing the test to break.
If anything, having the false security when all tests pass is worse, in
that it may prevent you from double checking something crucial.

I think tests for views makes sense when there is a condition that must
be tested, ex. if a new member must fill in additional fields that are
made visible only when they are from a certain country.  A test may then
make sense to ensure that the fields exist.

I am still a noob, so if anyone can enlighten me I would appreciate it.

Thanks
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list