aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_for_integration_test.rb
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2015-09-02 06:35:44 -0400
committereileencodes <eileencodes@gmail.com>2015-09-02 09:18:46 -0400
commitec14aad419381b502f510a9b3360f0e211e41066 (patch)
tree2e2a88802d6890185a872ff7fa35ec82778b4006 /actionpack/test/controller/url_for_integration_test.rb
parent1829943943f9f52e02ca15430490a53d1a1ec0b5 (diff)
downloadrails-ec14aad419381b502f510a9b3360f0e211e41066.tar.gz
rails-ec14aad419381b502f510a9b3360f0e211e41066.tar.bz2
rails-ec14aad419381b502f510a9b3360f0e211e41066.zip
Fix route creation when format is a blank string
Commit bff61ba, while reducing allocations, caused a regression when an empty format is passed to a route. This can happen in cases where you're using an anchor tag, for example: `https://example.com/parent/575256966.#child_1032289285`. Because of this change `format` was getting sent in `parameterized_parts` when previously it was not included. This resulted in blank `format`'s being returned as `.` when if there was an extension included it would be `.extension`. Since there was no extension this caused incorrect URL's. The test shows this would result in `/posts/show/1.` instead of `/posts/show/1` which causes bad urls since the format is not present.
Diffstat (limited to 'actionpack/test/controller/url_for_integration_test.rb')
-rw-r--r--actionpack/test/controller/url_for_integration_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_integration_test.rb b/actionpack/test/controller/url_for_integration_test.rb
index 0e4c2b7c32..dfc2712e3e 100644
--- a/actionpack/test/controller/url_for_integration_test.rb
+++ b/actionpack/test/controller/url_for_integration_test.rb
@@ -158,6 +158,7 @@ module ActionPack
['/posts/ping',[ { :controller => 'posts', :action => 'ping' }]],
['/posts/show/1',[ { :controller => 'posts', :action => 'show', :id => '1' }]],
+ ['/posts/show/1',[ { :controller => 'posts', :action => 'show', :id => '1', :format => '' }]],
['/posts',[ { :controller => 'posts' }]],
['/posts',[ { :controller => 'posts', :action => 'index' }]],
['/posts/create',[ { :action => 'create' }, {:day=>nil, :month=>nil, :controller=>"posts", :action=>"show_date"}, '/blog']],