Skip to content

Instantly share code, notes, and snippets.

Embed
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 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
You can’t perform that action at this time.