Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Webrat
- class SinatraSession < RackSession #:nodoc:
- include Sinatra::Test::Methods
- attr_reader :request, :response
- %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)
- request_page(@response.location, :get, {}) while @response.redirect?
- pp current_url
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment