fixing spec for Inherited Resource parent loading
This commit is contained in:
		
							parent
							
								
									2c2fa306cc
								
							
						
					
					
						commit
						3a07d62782
					
				@ -25,9 +25,9 @@ describe CanCan::InheritedResource do
 | 
				
			|||||||
    @controller.instance_variable_get(:@project).should == :project_resource
 | 
					    @controller.instance_variable_get(:@project).should == :project_resource
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  it "index should load through @controller.parent when parent" do
 | 
					  it "index should load through @controller.association_chain when parent" do
 | 
				
			||||||
    @params[:action] = "index"
 | 
					    @params[:action] = "index"
 | 
				
			||||||
    stub(@controller).parent { :project_resource }
 | 
					    stub(@controller).association_chain { @controller.instance_variable_set(:@project, :project_resource) }
 | 
				
			||||||
    CanCan::InheritedResource.new(@controller, :parent => true).load_resource
 | 
					    CanCan::InheritedResource.new(@controller, :parent => true).load_resource
 | 
				
			||||||
    @controller.instance_variable_get(:@project).should == :project_resource
 | 
					    @controller.instance_variable_get(:@project).should == :project_resource
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user