More complete Sinatra support

This commit is contained in:
Aslak Hellesøy 2008-10-17 12:38:59 +02:00
parent 682f4d19f9
commit a885a80a7b
1 changed files with 6 additions and 6 deletions

View File

@ -6,12 +6,12 @@ module Webrat
class SinatraSession < RackSession class SinatraSession < RackSession
include Sinatra::Test::Methods include Sinatra::Test::Methods
def get(url, data, headers = nil) %w(get head post put delete).each do |verb|
get_it(url, data) define_method(verb) do |*args|
end url, data, headers = *args
self.__send__("#{verb}_it", url, data)
def post(url, data, headers = nil) follow! while @response.redirect?
post_it(url, data) end
end end
end end
end end