Permalink
Browse files

Added failing spec for mysql / mysql2 adapter

  • Loading branch information...
1 parent 55c5986 commit 38e5ce901ab655f797aa15e4f15edc07c285b563 @BDQ BDQ committed Mar 20, 2012
Showing with 25 additions and 2 deletions.
  1. +25 −2 spec/database_spec.rb
View
@@ -1,7 +1,30 @@
require 'spec_helper'
describe Apartment::Database do
-
+ context "using mysql" do
+ # See apartment.yml file in dummy app config
+
+ let(:config){ Apartment::Test.config['connections']['mysql'].symbolize_keys }
+
+ before do
+ ActiveRecord::Base.establish_connection config
+ Apartment::Test.load_schema # load the Rails schema in the public db schema
+ subject.stub(:config).and_return config # Use postgresql database config for this test
+ end
+
+ describe "#adapter" do
+ before do
+ subject.reload!
+ end
+
+ it "should load mysql adapter" do
+ subject.adapter
+ Apartment::Adapters::MysqlAdapter.should be_a(Class)
+ end
+
+ end
+ end
+
context "using postgresql" do
# See apartment.yml file in dummy app config
@@ -107,4 +130,4 @@
end
end
-end
+end

0 comments on commit 38e5ce9

Please sign in to comment.