Sha256: 39127e594f7b3be28e0e3406149ff3754afa786200a44419428ffb6438cf204c
Contents?: true
Size: 1.79 KB
Versions: 9
Compression:
Stored size: 1.79 KB
Contents
# Sets up the Rails environment for Cucumber ENV["RAILS_ENV"] ||= "cucumber" require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') require File.expand_path(File.dirname(__FILE__) + '/../../test/test_helper') require 'cucumber/rails/world' require 'cucumber/formatter/unicode' # Blog out this line if you don't want Cucumber Unicode support require 'database_cleaner' require 'database_cleaner/cucumber' DatabaseCleaner.strategy = :truncation Cucumber::Rails.use_transactional_fixtures # Blog out the next line if you want Rails' own error handling # (e.g. rescue_action_in_public / rescue_responses / rescue_from) Cucumber::Rails.bypass_rescue require 'webrat' require 'cucumber/webrat/table_locator' # Lets you do table.diff!(table_at('#my_table').to_a) # Blog 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/core/matchers' Webrat.configure do |config| config.mode = :rails end # Webrat.configure do |config| # config.mode = :selenium # config.application_environment = :test # config.application_framework = :rails # end # To enable selenium: # 1. sudo gem install selenium-client # 2. unblog Webrat.configure that contains :selenium and then blog out the one that contains :rails above # 3. set: self.use_transactional_fixtures = false in test_helper.rb # 4. unblog in test_helper.rb: # setup do |session| # session.host! "localhost:3001" # end # 5. Be sure to apply the patch mentioned in the viget article below found here: http://gist.github.com/141590 # References: # http://www.brynary.com/2009/4/6/switching-webrat-to-selenium-mode # http://www.viget.com/extend/getting-started-with-webrat-selenium-rails-and-firefox-3/
Version data entries
9 entries across 9 versions & 1 rubygems