require "rubygems" require "sinatra" use_in_file_templates! get "/" do erb :home end get "/go" do erb :go end get "/internal_redirect" do redirect "/" end get "/external_redirect" do redirect "http://google.com" end post "/go" do @user = params[:name] @email = params[:email] erb :hello end __END__ @@ layout sinatra testing with webrat <%= yield %> @@ home

visit there

@@ go
@@ hello

Hello, <%= @user %>

Your email is: <%= @email %>