Skip to content

Instantly share code, notes, and snippets.

@sigmike
Created May 8, 2009 19:52
Show Gist options
  • Save sigmike/108972 to your computer and use it in GitHub Desktop.
Save sigmike/108972 to your computer and use it in GitHub Desktop.
# the steps:
When /^I go to the website$/ do
get '/'
end
Then /^there should be a link to the vote page$/ do
response.body.should include("layout")
end
# views/layout.haml
!!!
%html
%body
layout
= yield
# sinatra_app.rb:
require 'rubygems'
require 'sinatra'
configure :production do
# Configure stuff here you'll want to
# only be run at Heroku at boot
# TIP: You can get you database information
# from ENV['DATABASE_URI'] (see /env route below)
end
get '/' do
haml "%p Hello !"
end
# the result:
Scenario: I go voting # features/vote.feature:3
When I go to the website # features/steps/website_steps.rb:12
Then there should be a link to the vote page # features/steps/website_steps.rb:16
expected "<p>Hello !</p>\n" to include "layout" (Spec::Expectations::ExpectationNotMetError)
features/vote.feature:5:in `Then there should be a link to the vote page'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment