Created
March 4, 2011 19:58
-
-
Save oliverbarnes/855604 to your computer and use it in GitHub Desktop.
Cucumber setup with spork and database_cleaner for mongo_mapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= "test" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
...cucumber and capybara requires... | |
require 'database_cleaner' | |
require 'database_cleaner/cucumber' | |
require 'database_cleaner/mongo_mapper/truncation' | |
DatabaseCleaner.strategy = :truncation | |
end | |
Spork.each_run do | |
ActionController::Base.allow_rescue = false | |
Before do | |
DatabaseCleaner.start | |
end | |
After do | |
DatabaseCleaner.clean | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment