Skip to content

Instantly share code, notes, and snippets.

@julienXX
Created September 1, 2010 09:08
Show Gist options
  • Save julienXX/560441 to your computer and use it in GitHub Desktop.
Save julienXX/560441 to your computer and use it in GitHub Desktop.
# 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
@julienXX
Copy link
Author

julienXX commented Sep 1, 2010

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment