[rspec-users] Mocking kills usefullness of controller tests?

Artūras Šlajus lists at ruby-forum.com
Tue Feb 19 16:41:18 EST 2008


Let's say we mock our User objects in controllers. Then we change
attr_accessible in user.rb. Model tests break, controller do not.

You fix the model ones and go on thinking everything is ok when it's not
(the controllers are broken).

Even with technique in http://www.ruby-forum.com/topic/128149 you would
only be testing if attr_accessible gets called. It wouldn't show you
places in your controllers where you need to change that mass assignment
to attribute assignment.

Any ideas how to prevent it?
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list