More complete Sinatra support
This commit is contained in:
parent
682f4d19f9
commit
a885a80a7b
@ -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|
|
||||||
|
url, data, headers = *args
|
||||||
|
self.__send__("#{verb}_it", url, data)
|
||||||
|
follow! while @response.redirect?
|
||||||
end
|
end
|
||||||
|
|
||||||
def post(url, data, headers = nil)
|
|
||||||
post_it(url, data)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user