mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix last changeset to pass unittests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
741316dc71
commit
2e175d35cd
2 changed files with 8 additions and 6 deletions
|
@ -138,7 +138,9 @@ module Test #:nodoc:
|
|||
# Load routes.rb if it hasn't been loaded.
|
||||
ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
|
||||
|
||||
generated_path, found_extras = ActionController::Routing::Routes.generate(options, extras)
|
||||
generated_path, extra_keys = ActionController::Routing::Routes.generate(options, extras)
|
||||
found_extras = options.reject {|k, v| ! extra_keys.include? k}
|
||||
|
||||
msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
|
||||
assert_block(msg) { found_extras == extras }
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ module ActionController
|
|||
rewritten_url
|
||||
end
|
||||
|
||||
def rewrite_path(original_options)
|
||||
options = original_options.symbolize_keys
|
||||
options.update(params.symbolize_keys) if (params = options[:params])
|
||||
def rewrite_path(options)
|
||||
options = options.symbolize_keys
|
||||
options.update(options[:params].symbolize_keys) if options[:params]
|
||||
RESERVED_OPTIONS.each {|k| options.delete k}
|
||||
path, extra_keys = Routing::Routes.generate(options, @request) # Warning: Routes will mutate and violate the options hash
|
||||
path, extra_keys = Routing::Routes.generate(options.dup, @request) # Warning: Routes will mutate and violate the options hash
|
||||
|
||||
path << build_query_string(original_options.symbolize_keys, extra_keys) unless extra_keys.empty?
|
||||
path << build_query_string(options, extra_keys) unless extra_keys.empty?
|
||||
|
||||
path
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue