Skip to content

Commit

Permalink
Fix generating params with optional defaults [#3404 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Dec 1, 2009
1 parent 6ac32a8 commit 61a31f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -175,7 +175,7 @@ def optionalize_trailing_dynamic_segments(path, requirements, defaults) #:nodoc:
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
Expand Down
4 changes: 1 addition & 3 deletions actionpack/test/controller/routing_test.rb
Expand Up @@ -1639,9 +1639,7 @@ def test_generate_with_default_params
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
Expand Down

0 comments on commit 61a31f3

Please sign in to comment.