×
Eventil - Find Tech Events
Official mobile app
FREE - In Google Play
View
×
Eventil
Official mobile app
FREE - In App Store
View
Video not available
Add video

Controller Testing: You’re Doing It Wrong

0 0

How do you feel about your controller testing strategy? Do you feel begrudgingly obligated to write them? Do you find yourself stubbing methods like find_by only to feel a vague sense of dissatisfaction? Is your test suite soul-crushingly slow because you’re relying on integration specs to test controllers? Do you write controller specs at all? Rails controllers are wonderfully idiomatic and declarative to the point of being almost redundant. This is a good thing; it keeps many concerns like authentication and server response consistent while keeping business logic in models where it belongs. But this same simplicity leaves many developers conflicted about how and what to test in controller specs. To properly test Rails controllers we need a testing strategy as declarative as the controllers themselves. Come find out how to write controller specs that are as simple and concise as well written Rails controllers!

RubyKaigi 2014

Kaigi at the East End of Tokyo