Permalink
Browse files

appeases the crappy worthless specs... I should really redo all of this

  • Loading branch information...
1 parent a469347 commit 4cdaaa03522df03aad168e8c46af1a85a9b8e6d6 @bmabey bmabey committed Aug 25, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/database_cleaner/active_record/base.rb
  2. +1 −0 spec/database_cleaner/active_record/base_spec.rb
@@ -46,7 +46,7 @@ def connection_klass
return ::ActiveRecord::Base unless connection_hash
if ::ActiveRecord::Base.respond_to?(:descendants)
- database_name = connection_hash["database"]
+ database_name = connection_hash["database"] || connection_hash[:database]
models = ::ActiveRecord::Base.descendants
klass = models.detect {|m| m.connection_pool.spec.config[:database] == database_name}
return klass if klass
@@ -123,6 +123,7 @@ class ExampleStrategy
context "when connection_hash is set" do
let(:hash) { mock("hash") }
+ before { ::ActiveRecord::Base.stub!(:respond_to?).and_return(false)}
before { subject.stub(:connection_hash).and_return(hash) }
it "should create connection_klass if it doesnt exist if connection_hash is set" do

0 comments on commit 4cdaaa0

Please sign in to comment.