Sha256: 374ff2663f0e04ba23db4d75383985773d38a775716d40744535b9395571ad30

Contents?: true

Size: 534 Bytes

Versions: 5

Compression:

Stored size: 534 Bytes

Contents

require 'webrat/rack'
require 'sinatra'
require 'sinatra/test/methods'

module Webrat
  class SinatraSession < RackSession #:nodoc:
    include Sinatra::Test::Methods

    %w(get head post put delete).each do |verb|
      define_method(verb) do |*args| # (path, data, headers = nil)
        path, data, headers = *args
        params = data.merge({:env => headers || {}})
        self.__send__("#{verb}_it", path, params)
        follow! while @response.redirect?
      end
    end
    
  end
end

Webrat.configuration.mode = :sinatra

Version data entries

5 entries across 5 versions & 4 rubygems

Version Path
aslakhellesoy-webrat-0.3.2.1 lib/webrat/sinatra.rb
benschwarz-webrat-0.3.2.1 lib/webrat/sinatra.rb
brynary-webrat-0.3.2.1 lib/webrat/sinatra.rb
brynary-webrat-0.3.2.2 lib/webrat/sinatra.rb
flazz-webrat-0.3.2.1 lib/webrat/sinatra.rb