Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

connect to mongodb by mongoid3 way

  • Loading branch information...
commit 8b12bdffc53ed8f203439794696b5a7c58364236 1 parent d3ad824
@flyerhzm authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 spec/support/mongo_seed.rb
View
9 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
Please sign in to comment.
Something went wrong with that request. Please try again.