In rails 3, the layouts ivar is @layouts. In Rails 4 it's @_layouts. See: https://github.com/thoughtbot/shoulda-matchers/commit/545da09876d052582168afb43762decfdfa6890d