How do I test controllers and views?

Posted by ryeguy on Stack Overflow See other posts from Stack Overflow or by ryeguy
Published on 2010-04-12T02:54:47Z Indexed on 2010/04/12 3:03 UTC
Read the original article Hit count: 329

Filed under:

I'm using rails for the first time, and I love how test-oriented it is and how it encourages you to write tests. I'm just having a hard time figuring out what I should be testing when I test controllers and views. I know that you should test redirects and authorization in the controller tests, but what else? And what should go in view tests? If I'm "following the rules" and only putting loops, conditionals, and echoes in my views, then what is there left to test?

© Stack Overflow or respective owner

Related posts about unit-testing