Permalink
Browse files

Fix mongo mapper setup in specs

  • Loading branch information...
1 parent 9c84276 commit 77e8df46a971e34f9f0a83ba532f0d2fb4e19809 @bkeepers bkeepers committed Apr 10, 2010
Showing with 7 additions and 2 deletions.
  1. +2 −0 benchmarks.rb
  2. +4 −2 spec/setup/mongo_mapper.rb
  3. +1 −0 spec/spec_helper.rb
View
2 benchmarks.rb
@@ -4,6 +4,8 @@
require 'delayed_job'
require 'benchmark'
+RAILS_ENV = 'test'
+
Delayed::Worker.logger = Logger.new('/dev/null')
BACKENDS = []
View
6 spec/setup/mongo_mapper.rb
@@ -1,7 +1,9 @@
require 'mongo_mapper'
-MongoMapper.connection = Mongo::Connection.new nil, nil, :logger => Delayed::Worker.logger
-MongoMapper.database = 'delayed_job'
+MongoMapper.config = {
+ RAILS_ENV => {'database' => 'delayed_job'}
+}
+MongoMapper.connect RAILS_ENV
unless defined?(Story)
class Story
View
1 spec/spec_helper.rb
@@ -8,6 +8,7 @@
require 'sample_jobs'
Delayed::Worker.logger = Logger.new('/tmp/dj.log')
+RAILS_ENV = 'test'
# determine the available backends
BACKENDS = []

0 comments on commit 77e8df4

Please sign in to comment.