diff options
| author | Andrew White <pixeltrix@users.noreply.github.com> | 2014-12-13 16:21:55 +0000 |
|---|---|---|
| committer | Andrew White <pixeltrix@users.noreply.github.com> | 2014-12-13 16:21:55 +0000 |
| commit | c709925d2d9b4f7ea50e1f0242b5cd2496ccdcb6 (patch) | |
| tree | 364f24c8e612f63d6ca1739a38353ff9f1d23455 /actionpack/test/dispatch | |
| parent | 9688270d3e0994ce57de0adbc72b3ab4faaf2c32 (diff) | |
| parent | 1a50be823186082e8b5a29d8e9ea3a289318d9c1 (diff) | |
| download | rails-c709925d2d9b4f7ea50e1f0242b5cd2496ccdcb6.tar.gz rails-c709925d2d9b4f7ea50e1f0242b5cd2496ccdcb6.tar.bz2 rails-c709925d2d9b4f7ea50e1f0242b5cd2496ccdcb6.zip | |
Merge pull request #18020 from binaryberry/handle-positional-args-with-format-false
Fix handling of positional url helper arguments when format is false
Diffstat (limited to 'actionpack/test/dispatch')
| -rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index d0a624784a..aae95fb355 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -4433,3 +4433,31 @@ class TestUrlGenerationErrors < ActionDispatch::IntegrationTest assert_equal message, error.message end end + +class TestDefaultUrlOptions < ActionDispatch::IntegrationTest + class PostsController < ActionController::Base + def archive + render :text => "posts#archive" + end + end + + Routes = ActionDispatch::Routing::RouteSet.new + Routes.draw do + default_url_options locale: 'en' + scope ':locale', format: false do + get '/posts/:year/:month/:day', to: 'posts#archive', as: 'archived_posts' + end + end + + APP = build_app Routes + + def app + APP + end + + include Routes.url_helpers + + def test_positional_args_with_format_false + assert_equal '/en/posts/2014/12/13', archived_posts_path(2014, 12, 13) + end +end |
