Skip to content

Instantly share code, notes, and snippets.

config.after_initialize do
MVOR::Gateway.use_3ds_test_gateway
end
require 'rubygems'
require 'spork'
Spork.prefork do
# 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.join(File.dirname(__FILE__), "..", "support", "paths"))
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "textmate_formatter"))
describe Customer, "last billing address" do
before do
@customer = Customer.generate!
@customer = Address.new
end
it "should be settable and gettable" do
@customer.last_billing_address = @account_address
@customer.last_billing_address.should == @account_address
end
...
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new(:webrat) do |t|
t.fork = true # Explicitly fork for cucumber 0.3.4 and rails
t.cucumber_opts = "--format progress"
t.step_list = %w{features/support/env.rb features/support/webrat.rb features/step_definitions}
t.feature_list = %w{features/webrat}
end
task :webrat => 'db:test:prepare'
Background:
Given an admin user Philip exists
When I login as Philip
Then I should be logged in as Philip
Scenario Outline: Admin can view resources
Given there are 3 <object>
When I goto admin_<collection>
Then I should see a list of <item>
Feature: Background
In for background to work properly
As a user
I want it to run transactionally and only once when I call an individual scenario
Background:
Given plop
Scenario: Barping
When I barp
@diabolo
diabolo / Cucumber.haml
Created January 30, 2009 04:33
Possible html output for cucumber
.comment
Comments in this file are this color and wrapped in a "div class="comment"". There not expected to be in the output
.run
.info
date command project etc.
.summary
%h3
Summary
%span (click on any summary item to go the step)