Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
default: -r features/support/env.rb -r features/support/plain.rb -r features/step_definitions features/plain
selenium: -r features/support/env.rb -r features/support/enhanced.rb -r features/step_definitions features/enhanced
# see for help
require 'spec/expectations'
require 'selenium'
require 'webrat'
Webrat.configure do |config|
config.mode = :selenium
# Selenium defaults to using the selenium environment. Use the following to override this.
config.application_environment = :test
require 'database_cleaner'
require 'database_cleaner/cucumber'
DatabaseCleaner.strategy = :truncation
ENV["RAILS_ENV"] = "test"
# Sets up the Rails environment for Cucumber
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
require 'cucumber/formatters/unicode'
require 'webrat'
Webrat.configure do |config|
config.mode = :rails
require 'factory_girl'
require File.expand_path(File.dirname(__FILE__) + '../../../test/factories')
# TODO: database_cleaner cleans too much,
# probably also wipes out tog config settings
# which makes features fail
# require 'database_cleaner'
# truncate your tables here if you are using the same database as selenium, since selenium doesn't use transactional fixtures
# DatabaseCleaner.clean_with :truncation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.