Permalink
Browse files

connect to mongodb by mongoid3 way

  • Loading branch information...
1 parent d3ad824 commit 8b12bdffc53ed8f203439794696b5a7c58364236 @flyerhzm committed May 26, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 spec/support/mongo_seed.rb
@@ -29,11 +29,16 @@ def seed_db
end
def setup_db
- Mongoid.database = Mongo::Connection.new("localhost", 27017).db("bullet")
+ #Mongoid.database = Mongo::Connection.new("localhost", 27017).db("bullet")
+ Mongoid.configure do |config|
+ config.connect_to("bullet")
+ end
end
def teardown_db
- Mongoid.database.collections.select {|c| c.name !~ /system/ }.map(&:drop)
+ #Mongoid.database.collections.select {|c| c.name !~ /system/ }.map(&:drop)
+ Mongoid.purge!
+ Mongoid::IdentityMap.clear
end
extend self

0 comments on commit 8b12bdf

Please sign in to comment.