calling controller's load_resource and authorize_resource from load_and_authorize_resource to maintain backwards compatability, even though it's not the most efficient way

This commit is contained in:
Ryan Bates
2009-11-26 09:53:16 -08:00
parent da5a5c031f
commit e32c5d0dfb
3 changed files with 8 additions and 6 deletions

View File

@@ -37,8 +37,9 @@ describe CanCan::ControllerAdditions do
@controller.authorize_resource
end
it "should load and authorize resource in one call" do
mock.instance_of(CanCan::ResourceAuthorization).load_and_authorize_resource
it "should load and authorize resource in one call through controller" do
mock(@controller).load_resource
mock(@controller).authorize_resource
@controller.load_and_authorize_resource
end
end