mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
Fix broken assert_generates when extra keys are being checked.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Fix broken assert_generates when extra keys are being checked. [Jamis Buck]
|
||||
|
||||
* Replace KCODE checks with String#chars for truncate. Closes #6385 [Manfred Stienstra]
|
||||
|
||||
* Make page caching respect the format of the resource that is being requested even if the current route is the default route so that, e.g. posts.rss is not transformed by url_for to '/' and subsequently cached as '/index.html' when it should be cached as '/posts.rss'. [Marcel Molina Jr.]
|
||||
|
||||
@@ -40,7 +40,7 @@ module ActionController
|
||||
# Load routes.rb if it hasn't been loaded.
|
||||
ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
|
||||
|
||||
generated_path, extra_keys = ActionController::Routing::Routes.generate_extras(options, extras)
|
||||
generated_path, extra_keys = ActionController::Routing::Routes.generate_extras(options, defaults)
|
||||
found_extras = options.reject {|k, v| ! extra_keys.include? k}
|
||||
|
||||
msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
|
||||
|
||||
@@ -310,6 +310,10 @@ HTML
|
||||
|
||||
def test_assert_generates
|
||||
assert_generates 'controller/action/5', :controller => 'controller', :action => 'action', :id => '5'
|
||||
assert_generates 'controller/action/7', {:id => "7"}, {:controller => "controller", :action => "action"}
|
||||
assert_generates 'controller/action/5', {:controller => "controller", :action => "action", :id => "5", :name => "bob"}, {}, {:name => "bob"}
|
||||
assert_generates 'controller/action/7', {:id => "7", :name => "bob"}, {:controller => "controller", :action => "action"}, {:name => "bob"}
|
||||
assert_generates 'controller/action/7', {:id => "7"}, {:controller => "controller", :action => "action", :name => "bob"}, {}
|
||||
end
|
||||
|
||||
def test_assert_routing
|
||||
|
||||
Reference in New Issue
Block a user