Sha256: 240c6f02548220bb742f9fd8e42ff3e7c7ad81d47c8276213bb18edff6156a31

Contents?: true

Size: 687 Bytes

Versions: 13

Compression:

Stored size: 687 Bytes

Contents

require "sinatra/base"

class SampleApp < Sinatra::Default
  get "/" do
    "Hello World"
  end

  get "/internal_redirect" do
    redirect URI.join(request.url, "redirected").to_s
  end

  get "/external_redirect" do
    redirect "http://example.tst/"
  end

  get "/redirected" do
    "Redirected"
  end

  get "/form" do
    <<-EOS
    <html>
      <form action="/form" method="post">
        <input type="hidden" name="_method" value="put" />
        <label for="email">Email:</label> <input type="text" id="email" name="email" /></label>
        <input type="submit" value="Add" />
      </form>
    </html>
    EOS
  end

  put "/form" do
    "Welcome #{params[:email]}"
  end
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/spec/integration/mechanize/sample_app.rb
indirect-webrat-0.7.5 spec/integration/mechanize/sample_app.rb
indirect-webrat-0.7.4 spec/integration/mechanize/sample_app.rb
webrat-0.7.3 spec/integration/mechanize/sample_app.rb
jbd-webrat-0.7.2.rails3 spec/integration/mechanize/sample_app.rb
webrat-0.7.2 spec/integration/mechanize/sample_app.rb
webrat-0.7.2.beta.2 spec/integration/mechanize/sample_app.rb
mutle-webrat-0.7.2.beta.1 spec/integration/mechanize/sample_app.rb
thoughtbot-webrat-0.7.2.pre spec/integration/mechanize/sample_app.rb
webrat-0.7.2.beta.1 spec/integration/mechanize/sample_app.rb
honkster-webrat-0.7.1.2 spec/integration/mechanize/sample_app.rb
honkster-webrat-0.7.1.1 spec/integration/mechanize/sample_app.rb
webrat-0.7.1 spec/integration/mechanize/sample_app.rb