Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
fixing tests for passing action name through to accessible_by call
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Feb 14, 2011
1 parent 471d54c commit 3901cbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/cancan/controller_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
end

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"
resource = CanCan::ControllerResource.new(@controller, :project)
resource.load_resource
Expand Down
2 changes: 1 addition & 1 deletion spec/cancan/inherited_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

it "index should load through @controller.end_of_association_chain" do
@params[:action] = "index"
stub(Project).accessible_by(@ability) { :projects }
stub(Project).accessible_by(@ability, :index) { :projects }
stub(@controller).end_of_association_chain { Project }
CanCan::InheritedResource.new(@controller).load_resource
@controller.instance_variable_get(:@projects).should == :projects
Expand Down

0 comments on commit 3901cbe

Please sign in to comment.