class ActionDispatch::Integration::Session

def build_expanded_path(path)

def build_expanded_path(path)
  location = URI.parse(path)
  yield location if block_given?
  path = location.path
  location.query ? "#{path}?#{location.query}" : path
end