Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def should_require_logged_in(method = :get, action = :index)
  2. context "require a current user for #{action.to_s} using method #{method.to_s}" do
  3. setup do
  4. if method == :post
  5. post action
  6. else
  7. get action
  8. end
  9. end
  10.  
  11. should redirect_to login_path
  12. end
  13. end
Add Comment
Please, Sign In to add comment