Skip to content
Browse files

rdoc for bypass_rescue

  • Loading branch information...
1 parent 88137f2 commit 4c7fd730887b254d2c53eff2ccae85a6c01ddd20 @dchelimsky dchelimsky committed Dec 7, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/rspec/rails/example/controller_example_group.rb
View
14 lib/rspec/rails/example/controller_example_group.rb
@@ -167,6 +167,20 @@ def rescue_with_handler(exception)
# `rescue_with_handler` to raise the exception passed to it. Use this to
# specify that an action _should_ raise an exception given appropriate
# 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
controller.extend(BypassRescue)
end

0 comments on commit 4c7fd73

Please sign in to comment.
Something went wrong with that request. Please try again.