diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/test_case_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 7 |
3 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index aca9f03748..f46b32e019 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1386,7 +1386,7 @@ class RouteSetTest < ActiveSupport::TestCase url = controller.url_for({ :controller => "connection", :only_path => true }) assert_equal "/connection/connection", url - url = controller.url_for({ :use_route => :family_connection, + url = controller.url_for({ :use_route => "family_connection", :controller => "connection", :only_path => true }) assert_equal "/connection", url end diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index fdabad3abd..ba2ff7d12c 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -528,7 +528,7 @@ XML get 'via_named_route', as: :a_named_route, to: 'test_case_test/test#test_uri' end - get :test_uri, use_route: :a_named_route + assert_deprecated { get :test_uri, use_route: :a_named_route } assert_equal '/via_named_route', @response.body end end @@ -798,7 +798,7 @@ module EngineControllerTests with_routing do |set| set.draw { mount Engine => '/foo' } - get :index, use_route: :foo + assert_deprecated { get :index, use_route: :foo } assert_equal @response.body, 'bar' end end diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index f0eba17556..0ffa2d2a03 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -290,6 +290,13 @@ module AbstractController end end + def test_using_nil_script_name_properly_concats_with_original_script_name + add_host! + assert_equal('https://www.basecamphq.com/subdir/c/a/i', + W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https', :script_name => nil, :original_script_name => '/subdir') + ) + end + def test_only_path with_routing do |set| set.draw do |