fixing tests for passing action name through to accessible_by call
This commit is contained in:
parent
471d54ce01
commit
3901cbe499
|
@ -67,7 +67,7 @@ describe CanCan::ControllerResource do
|
|||
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
|
||||
|
|
|
@ -34,7 +34,7 @@ describe CanCan::InheritedResource do
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user