1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix generating params with optional defaults [#3404 state:resolved]

This commit is contained in:
Joshua Peek 2009-12-01 14:52:19 -06:00
parent 6ac32a8328
commit 61a31f3d3d
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -1639,10 +1639,8 @@ class RouteSetTest < ActiveSupport::TestCase
map.connect ':controller/:action/:id'
end
pending do
assert_equal '/ibocorp', set.generate({:controller => 'ibocorp', :page => 1})
end
end
def test_generate_with_optional_params_recalls_last_request
set.draw do |map|