From eafd6cfcde74073711943df5a3726497a8f02576 Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Wed, 28 Sep 2011 13:50:46 -0700 Subject: [PATCH] fixing spec for new id_param option --- spec/cancan/controller_resource_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/cancan/controller_resource_spec.rb b/spec/cancan/controller_resource_spec.rb index d345760..03ab1d0 100644 --- a/spec/cancan/controller_resource_spec.rb +++ b/spec/cancan/controller_resource_spec.rb @@ -325,15 +325,15 @@ describe CanCan::ControllerResource do lambda { resource.process }.should raise_error(CanCan::Unauthorized) @controller.instance_variable_get(:@custom_project).should == project end - + it "should load resource using custom ID param" do project = Project.create! @params.merge!(:action => "show", :the_project => project.id) - resource = CanCan::ControllerResource.new(@controller, :id_param => :the_project) - resource.load_resource + resource = CanCan::ControllerResource.new(@controller, :id_param => :the_project, :load => true) + resource.process @controller.instance_variable_get(:@project).should == project end - + it "should load resource using custom find_by attribute" do project = Project.create!(:name => "foo") @params.merge!(:action => "show", :id => "foo")