Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def should_require_logged_in(method = :get, action = :index)
- context "require a current user for #{action.to_s} using method #{method.to_s}" do
- setup do
- if method == :post
- post action
- else
- get action
- end
- end
- should redirect_to login_path
- end
- end
Add Comment
Please, Sign In to add comment