Created
May 23, 2012 23:52
-
-
Save patrick99e99/2778523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe OffersController do | |
def do_create | |
post :create, { :post_id => bb_request.id, :offer => new_offer.attributes } | |
end | |
shared_examples "an access controlled action" do |action_proc| | |
it "denies access if the post is not verified" do | |
expect(&action_proc).to raise_error(CanCan::AccessDenied) | |
end | |
end | |
describe "#create" do | |
it_behaves_like "an access controlled action", proc { do_create } | |
end | |
end | |
... | |
Failure/Error: expect(&action_proc).to raise_error(CanCan::AccessDenied) | |
expected CanCan::AccessDenied, got #<NameError: undefined local variable or method `do_create' for RSpec::Core::ExampleGroup::Nested_1::Nested_2:Class> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment