Created
September 1, 2010 09:08
-
-
Save julienXX/560441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this file in config/initializers | |
module ActionController | |
module Integration | |
class Session | |
private | |
# Get a temporary URL writer object | |
def generic_url_rewriter | |
env = { | |
'REQUEST_METHOD' => "GET", | |
'QUERY_STRING' => "", | |
"REQUEST_URI" => "/", | |
"HTTP_HOST" => host, | |
"SERVER_PORT" => https? ? "443" : "80", | |
"HTTPS" => https? ? "on" : "off", | |
"rack.input" => StringIO.new | |
} | |
UrlRewriter.new(Request.new(env), {}) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a workaround for the Missing rack.input (RuntimeError) when trying to use Cucumber and Facebooker with Rails 2.3.8 / Rack >= 1.1.0.
See https://rails.lighthouseapp.com/projects/8994/tickets/5029-rackinput-for-generic_url_rewriter