diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-24 12:41:28 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-24 12:41:28 -0300 |
commit | ade105be402f178eae2eb3aaa7f221097a55eb2a (patch) | |
tree | 27333aed20eeabd89f1254f39bcbf67ebbfbe83a /actionpack/test/dispatch | |
parent | 286a8b7f2af9a109787a3ae3b93b15175d0933b6 (diff) | |
parent | 82b4d879bf31ebf409217e2c770cedfb7c79a44a (diff) | |
download | rails-ade105be402f178eae2eb3aaa7f221097a55eb2a.tar.gz rails-ade105be402f178eae2eb3aaa7f221097a55eb2a.tar.bz2 rails-ade105be402f178eae2eb3aaa7f221097a55eb2a.zip |
Merge pull request #14986 from dlangevin/trailing-slash-url-generation
Fixes URL generation with trailing_slash: true
Conflicts:
actionpack/lib/action_dispatch/http/url.rb
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/url_generation_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb index 910ff8a80f..a4dfd0a63d 100644 --- a/actionpack/test/dispatch/url_generation_test.rb +++ b/actionpack/test/dispatch/url_generation_test.rb @@ -15,6 +15,8 @@ module TestUrlGeneration Routes.draw do get "/foo", :to => "my_route_generating#index", :as => :foo + resources :bars + mount MyRouteGeneratingController.action(:index), at: '/bar' end @@ -109,6 +111,22 @@ module TestUrlGeneration test "omit subdomain when key is blank" do assert_equal "http://example.com/foo", foo_url(subdomain: "") end + + test "generating URLs with trailing slashes" do + assert_equal "/bars.json", bars_path( + trailing_slash: true, + format: 'json' + ) + end + + test "generating URLS with querystring and trailing slashes" do + assert_equal "/bars.json?a=b", bars_path( + trailing_slash: true, + a: 'b', + format: 'json' + ) + end + end end |