Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
Created June 13, 2009 20:35
Show Gist options
  • Save aslakhellesoy/129423 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/129423 to your computer and use it in GitHub Desktop.
module Whatsnext
class Application < Sinatra::Base
post '/features/*' do
puts request.body.read
end
end
end
# RSpec
require 'spec/expectations'
# Webrat
require 'rack/test'
require 'webrat/sinatra'
Webrat.configure do |config|
config.mode = :sinatra
end
World(Webrat::Matchers, Webrat::HaveTagMatcher, Rack::Test::Methods) do
context = OpenStruct.new(:app => Whatsnext::Application)
Webrat::SinatraSession.new(context)
end
When /^I save it as an existing file$/ do
post("/foo", 'bar')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment