Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created June 8, 2010 23:41
Show Gist options
  • Save agibralter/430807 to your computer and use it in GitHub Desktop.
Save agibralter/430807 to your computer and use it in GitHub Desktop.
a hack so facebooker doesn't cause cucumber steps to explode if using rack 1.1.0
ActionController::Integration::Session.class_eval do
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" => "wtf"
}
ActionController::UrlRewriter.new(ActionController::Request.new(env), {})
end
end
@granth
Copy link

granth commented Jun 9, 2010

Thanks!

@agibralter
Copy link
Author

You using that for the facebooker bug?

@granth
Copy link

granth commented Jun 9, 2010

Yeah. I had a bunch of "missing rack.input" errors. Some searching found your gist.

@mileszs
Copy link

mileszs commented Oct 1, 2010

Worked for me for the same bug. Thanks!

@Oceantidote
Copy link

LEGEND!!!!

@agibralter
Copy link
Author

image
lol glad it's still helpful!

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