Skip to content

Instantly share code, notes, and snippets.

@tomtt
Created April 2, 2009 19:52
Show Gist options
  • Save tomtt/89397 to your computer and use it in GitHub Desktop.
Save tomtt/89397 to your computer and use it in GitHub Desktop.
# 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/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
Cucumber::Rails.use_transactional_fixtures
Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
# (e.g. rescue_action_in_public / rescue_responses / rescue_from)
require 'webrat'
Webrat.configure do |config|
config.mode = :rails
end
require 'cucumber/rails/rspec'
require 'webrat/core/matchers'
require File.join(RAILS_ROOT, "spec", "factories")
require File.join(RAILS_ROOT, "spec", "shared_helper")
# In order to implement a consistent naming scheme for screenshots, we
# need access to the scenario from a step definition
Before do |scenario|
@__scenario = scenario
end
After do |scenario|
if scenario.has_tags?(["screenshot"])
debugger
a = 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment