elabs/pundit — pull request #58 by christiannelson (2013-10-25 18:36:39+00:00)
Title: Policy helper for rspec view specs

I use rspec for testing and write view specs on some projects. Using Pundit's ```policy``` helper in views to conditionally render markup works great in a running application, but fails when running view specs because the helper isn't available.

> ActionView::Template::Error: undefined method `policy'

I could define a helper in each view spec [using this technique](https://www.relishapp.com/rspec/rspec-rails/v/2-0/docs/view-specs/view-spec#spec-with-view-that-accesses-helper-method-helpers), but that feels a little cumbersome.

Can you recommend a best practice for stubbing out the policy helper for view specs? Is there an opportunity to add something to pundit to make this easier, or to have it work out-of-the-box given some assumptions?