Since you've mentioned 30 lines I guess your app is doing something more complex than trivial CRUD so... I find TDD to be a great guide. If you're writing a controller spec (mocking approach, as explained in the original RSpec book), than anything longer than ~5 lines is usually too much, because writing a sensible spec becomes just too hard. Have controller only pass params to other objects which live in lib or wherever your domain logic is.