Skip to content

Commit

Permalink
rdoc for bypass_rescue
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Dec 7, 2011
1 parent 88137f2 commit 4c7fd73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/rspec/rails/example/controller_example_group.rb
Expand Up @@ -167,6 +167,20 @@ def rescue_with_handler(exception)
# `rescue_with_handler` to raise the exception passed to it. Use this to # `rescue_with_handler` to raise the exception passed to it. Use this to
# specify that an action _should_ raise an exception given appropriate # specify that an action _should_ raise an exception given appropriate
# conditions. # conditions.
#
# @example
#
# describe ProfilesController do
# it "raises a 403 when a non-admin user tries to view another user's profile" do
# profile = create_profile
# login_as profile.user
#
# expect do
# bypass_rescue
# get :show, :id => profile.id + 1
# end.to raise_error(/403 Forbidden/)
# end
# end
def bypass_rescue def bypass_rescue
controller.extend(BypassRescue) controller.extend(BypassRescue)
end end
Expand Down

0 comments on commit 4c7fd73

Please sign in to comment.