Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created March 23, 2009 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save balinterdi/83635 to your computer and use it in GitHub Desktop.
Save balinterdi/83635 to your computer and use it in GitHub Desktop.
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 http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium 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
end
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
end
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
Cucumber::Rails.use_transactional_fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment