fixing tests for passing action name through to accessible_by call

This commit is contained in:
Ryan Bates 2011-02-14 10:33:53 -08:00
parent 471d54ce01
commit 3901cbe499
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ describe CanCan::ControllerResource do
end end
it "should build a collection when on index action when class responds to accessible_by" do it "should build a collection when on index action when class responds to accessible_by" do
stub(Project).accessible_by(@ability) { :found_projects } stub(Project).accessible_by(@ability, :index) { :found_projects }
@params[:action] = "index" @params[:action] = "index"
resource = CanCan::ControllerResource.new(@controller, :project) resource = CanCan::ControllerResource.new(@controller, :project)
resource.load_resource resource.load_resource

View File

@ -34,7 +34,7 @@ describe CanCan::InheritedResource do
it "index should load through @controller.end_of_association_chain" do it "index should load through @controller.end_of_association_chain" do
@params[:action] = "index" @params[:action] = "index"
stub(Project).accessible_by(@ability) { :projects } stub(Project).accessible_by(@ability, :index) { :projects }
stub(@controller).end_of_association_chain { Project } stub(@controller).end_of_association_chain { 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