Skip to content

Instantly share code, notes, and snippets.

@mepatterson
Created March 12, 2010 17:35
Show Gist options
  • Select an option

  • Save mepatterson/330557 to your computer and use it in GitHub Desktop.

Select an option

Save mepatterson/330557 to your computer and use it in GitHub Desktop.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require 'shoulda'
require File.expand_path(File.dirname(__FILE__) + "/blueprints.rb")
class ActiveSupport::TestCase
# Drop all collections after each test case.
def teardown
MongoMapper.database.collections.each do |coll|
coll.remove
end
end
# Make sure that each test case has a teardown
# method to clear the db after each test.
def inherited(base)
base.define_method teardown do
super
end
end
end
class ActionController::TestCase
include Devise::TestHelpers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment