Created
February 19, 2014 12:27
-
-
Save tadas-s/9090936 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
if Rails.env.test? | |
module ActionDispatch | |
module Routing | |
module UrlFor | |
alias_method :original_url_options, :url_options | |
def url_options | |
if self.respond_to? :request | |
original_url_options.merge({:host => request.host, :port => request.port}) | |
else | |
original_url_options | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment