aj1215
6/21/2010 - 7:24 PM

Rails 3 Mongoid Cucumber Setup

Rails 3 Mongoid Cucumber Setup

ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')

require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/rspec'
require 'cucumber/rails/world'
require 'cucumber/web/tableish'

require 'capybara/rails'
require 'capybara/cucumber'
require 'capybara/session'
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
Capybara.default_selector = :css

ActionController::Base.allow_rescue = false

Before do
  Mongoid.master.collections.reject { |c| c.name == 'system.indexes'}.each(&:drop)
end