Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing tests for passing action name through to accessible_by call

  • Loading branch information...
commit 3901cbe4994ec5cb089a2fe65705e6ee65e17891 1 parent 471d54c
@ryanb ryanb authored
View
2  spec/cancan/controller_resource_spec.rb
@@ -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
View
2  spec/cancan/inherited_resource_spec.rb
@@ -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

0 comments on commit 3901cbe

Please sign in to comment.
Something went wrong with that request. Please try again.