Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created June 21, 2010 19:24
Show Gist options
  • Save gmoeck/447343 to your computer and use it in GitHub Desktop.
Save gmoeck/447343 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment