mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fix generating params with optional defaults [#3404 state:resolved]
This commit is contained in:
@@ -175,7 +175,7 @@ module ActionDispatch
|
||||
optional = false
|
||||
elsif segment =~ /^:(\w+)$/
|
||||
if defaults.has_key?($1.to_sym)
|
||||
defaults.delete($1.to_sym)
|
||||
defaults.delete($1.to_sym) if defaults[$1.to_sym].nil?
|
||||
else
|
||||
optional = false
|
||||
end
|
||||
|
||||
@@ -1639,9 +1639,7 @@ class RouteSetTest < ActiveSupport::TestCase
|
||||
map.connect ':controller/:action/:id'
|
||||
end
|
||||
|
||||
pending do
|
||||
assert_equal '/ibocorp', set.generate({:controller => 'ibocorp', :page => 1})
|
||||
end
|
||||
assert_equal '/ibocorp', set.generate({:controller => 'ibocorp', :page => 1})
|
||||
end
|
||||
|
||||
def test_generate_with_optional_params_recalls_last_request
|
||||
|
||||
Reference in New Issue
Block a user