Skip to content
Snippets Groups Projects
Commit 3901cbe4 authored by Ryan Bates's avatar Ryan Bates
Browse files

fixing tests for passing action name through to accessible_by call

parent 471d54ce
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ describe CanCan::ControllerResource do ...@@ -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
......
...@@ -34,7 +34,7 @@ describe CanCan::InheritedResource do ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment