-
-
Save jasonong/127301 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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