Created
June 11, 2009 00:51
-
-
Save jasonong/127630 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' | |
DatabaseCleaner.strategy = :truncation | |
Before do | |
# truncating the database tables here, since transactional fixtures | |
# can not be used with selenium | |
DatabaseCleaner.clean | |
end |
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' # Comment out this line if you don't want Cucumber Unicode support | |
# Comment out the next two lines if you're not using RSpec's matchers (should / should_not) in your steps. | |
require 'cucumber/rails/rspec' | |
require 'webrat/rspec-rails' | |
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
require 'database_cleaner' | |
# truncate your tables here if you are using the same database as selenium, since selenium doesn't use transactional fixtures | |
DatabaseCleaner.strategy = :truncation | |
DatabaseCleaner.clean | |
Cucumber::Rails.use_transactional_fixtures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment