Merge branch 'inherited_resources_collection_fix' of https://github.com/tanordheim/cancan into tanordheim-inherited_resources_collection_fix
This commit is contained in:
commit
28a9a0ac07
|
@ -12,7 +12,7 @@ module CanCan
|
||||||
end
|
end
|
||||||
|
|
||||||
def resource_base
|
def resource_base
|
||||||
@controller.send :end_of_association_chain
|
@controller.send :collection
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,10 +32,10 @@ describe CanCan::InheritedResource do
|
||||||
@controller.instance_variable_get(:@project).should == :project_resource
|
@controller.instance_variable_get(:@project).should == :project_resource
|
||||||
end
|
end
|
||||||
|
|
||||||
it "index should load through @controller.end_of_association_chain" do
|
it "index should load through @controller.collection" do
|
||||||
@params[:action] = "index"
|
@params[:action] = "index"
|
||||||
stub(Project).accessible_by(@ability, :index) { :projects }
|
stub(Project).accessible_by(@ability, :index) { :projects }
|
||||||
stub(@controller).end_of_association_chain { Project }
|
stub(@controller).collection { Project }
|
||||||
CanCan::InheritedResource.new(@controller).load_resource
|
CanCan::InheritedResource.new(@controller).load_resource
|
||||||
@controller.instance_variable_get(:@projects).should == :projects
|
@controller.instance_variable_get(:@projects).should == :projects
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user