O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Helper Methods

Helper modules are the storage attic of Rails applications. They are designed to contain reusable bits of view logic. This might include view-specific representations of data, or conditional logic that governs how content is displayed. Helper modules tend to get filled with all kinds of clutter that doesn’t seem to belong anywhere else. Because they are a little tricky to set up for testing, helper methods often aren’t tested even when they contain significant amounts of logic.

RSpec helper tests go in spec/helpers. There’s not a whole lot of special magic here—just a helper object that you use to call your helper methods.

Let’s say we want to change our project view so behind-schedule projects show up differently. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required