spec/lib/database_server_spec.rb in switchman-1.0.0 vs spec/lib/database_server_spec.rb in switchman-1.1.0
- old
+ new
@@ -68,11 +68,15 @@
it "should be able to create a new sqlite shard from a given server" do
@db = DatabaseServer.create(:config => { :adapter => 'sqlite3', :database => '%{shard_name}', :shard_name => ':memory:' })
create_shard(@db)
end
- it "should be able to create a new shard from the default db" do
- create_shard(Shard.default.database_server)
+ context "non-transactional" do
+ self.use_transactional_fixtures = ::ActiveRecord::Base.connection.supports_ddl_transactions?
+
+ it "should be able to create a new shard from the default db" do
+ create_shard(Shard.default.database_server)
+ end
end
it "should be able to create a new shard from a db server that doesn't have any shards" do
# otherwise it's a repeat of the sqlite spec above
pending 'A "real" database"' unless %w{MySQL Mysql2 PostgreSQL}.include?(adapter)