Created
June 22, 2009 16:16
-
-
Save glennfu/134050 to your computer and use it in GitHub Desktop.
This file contains 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 --format progress features --tags ~@pending | |
selenium: -r features/support/env.rb -r features/support/enhanced.rb -r features/step_definitions features/enhanced features/plain --format progress features --tags ~@pending |
This file contains 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
Webrat.configure do |config| | |
config.mode = :selenium | |
# Selenium defaults to using the selenium environment. Use the following to override this. | |
# config.application_environment = :test | |
config.application_address = 'localhost' | |
config.application_port = 4444 | |
end | |
# this is necessary to have webrat "wait_for" the response body to be available | |
# when writing steps that match against the response body returned by selenium | |
World(Webrat::Selenium::Matchers) | |
Before do | |
# truncate your tables here, since you can't use transactional fixtures* | |
User.destroy_all | |
end |
This file contains 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
# Sets up the Rails environment for Cucumber | |
ENV["RAILS_ENV"] = "test" | |
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 | |
require 'webrat' | |
require 'webrat/rails' | |
require 'cucumber/rails/rspec' | |
This file contains 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 'webrat/core/matchers' | |
# truncate your tables here if you are using the same database as selenium, since selenium doesn't use transactional fixtures | |
Cucumber::Rails.use_transactional_fixtures | |
Webrat.configure do |config| | |
config.mode = :rails | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment