quick fix to get nested resources working again - closes #482

This commit is contained in:
Ryan Bates
2011-10-04 15:02:59 -07:00
parent 26b40f2b49
commit 67a3038628
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -197,8 +197,8 @@ describe CanCan::ControllerResource do
it "should load parent resource through proper id parameter" do
project = Project.create!
@params.merge!(:action => "index", :project_id => project.id)
resource = CanCan::ControllerResource.new(@controller, :project, :parent => true)
@params.merge!(:controller => "categories", :action => "index", :project_id => project.id)
resource = CanCan::ControllerResource.new(@controller, :project)
resource.load_resource
@controller.instance_variable_get(:@project).should == project
end
@@ -1,10 +1,6 @@
if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
require "spec_helper"
RSpec.configure do |config|
config.extend WithModel
end
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
describe CanCan::ModelAdapters::ActiveRecordAdapter do