From 4f96e739c215331562c09cd215536c35a85508fd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 24 Sep 2018 14:49:26 -0700 Subject: Remove deprecated catch-all route in the AV tests This commit removes a deprecated catch-all route in the AV tests. It defines and includes the necessary routes for each test such that we don't need the catch-all anymore. This also helps push us toward #33970 --- .../test/actionpack/controller/layout_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'actionview/test/actionpack/controller/layout_test.rb') diff --git a/actionview/test/actionpack/controller/layout_test.rb b/actionview/test/actionpack/controller/layout_test.rb index ff66ff2a1a..14acb737f9 100644 --- a/actionview/test/actionpack/controller/layout_test.rb +++ b/actionview/test/actionpack/controller/layout_test.rb @@ -48,6 +48,10 @@ end class LayoutAutoDiscoveryTest < ActionController::TestCase include TemplateHandlerHelper + with_routes do + get :hello, to: 'views#hello' + end + def setup super @request.host = "www.nextangle.com" @@ -148,6 +152,11 @@ class LayoutSetInResponseTest < ActionController::TestCase include ActionView::Template::Handlers include TemplateHandlerHelper + with_routes do + get :hello, to: 'views#hello' + get :hello, to: 'views#goodbye' + end + def test_layout_set_when_using_default_layout @controller = DefaultLayoutController.new get :hello @@ -234,6 +243,10 @@ class SetsNonExistentLayoutFile < LayoutTest end class LayoutExceptionRaisedTest < ActionController::TestCase + with_routes do + get :hello, to: 'views#hello' + end + def test_exception_raised_when_layout_file_not_found @controller = SetsNonExistentLayoutFile.new assert_raise(ActionView::MissingTemplate) { get :hello } @@ -247,6 +260,10 @@ class LayoutStatusIsRendered < LayoutTest end class LayoutStatusIsRenderedTest < ActionController::TestCase + with_routes do + get :hello, to: 'views#hello' + end + def test_layout_status_is_rendered @controller = LayoutStatusIsRendered.new get :hello @@ -260,6 +277,10 @@ unless Gem.win_platform? end class LayoutSymlinkedIsRenderedTest < ActionController::TestCase + with_routes do + get :hello, to: 'views#hello' + end + def test_symlinked_layout_is_rendered @controller = LayoutSymlinkedTest.new get :hello -- cgit v1.2.3 From 3301804ff6abcd5aae06cc5acbb82bc6a472f008 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 24 Sep 2018 16:01:34 -0700 Subject: make bot happy --- actionview/test/actionpack/controller/layout_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionview/test/actionpack/controller/layout_test.rb') diff --git a/actionview/test/actionpack/controller/layout_test.rb b/actionview/test/actionpack/controller/layout_test.rb index 14acb737f9..6d5c97b7fd 100644 --- a/actionview/test/actionpack/controller/layout_test.rb +++ b/actionview/test/actionpack/controller/layout_test.rb @@ -49,7 +49,7 @@ class LayoutAutoDiscoveryTest < ActionController::TestCase include TemplateHandlerHelper with_routes do - get :hello, to: 'views#hello' + get :hello, to: "views#hello" end def setup @@ -153,8 +153,8 @@ class LayoutSetInResponseTest < ActionController::TestCase include TemplateHandlerHelper with_routes do - get :hello, to: 'views#hello' - get :hello, to: 'views#goodbye' + get :hello, to: "views#hello" + get :hello, to: "views#goodbye" end def test_layout_set_when_using_default_layout @@ -244,7 +244,7 @@ end class LayoutExceptionRaisedTest < ActionController::TestCase with_routes do - get :hello, to: 'views#hello' + get :hello, to: "views#hello" end def test_exception_raised_when_layout_file_not_found @@ -261,7 +261,7 @@ end class LayoutStatusIsRenderedTest < ActionController::TestCase with_routes do - get :hello, to: 'views#hello' + get :hello, to: "views#hello" end def test_layout_status_is_rendered @@ -278,7 +278,7 @@ unless Gem.win_platform? class LayoutSymlinkedIsRenderedTest < ActionController::TestCase with_routes do - get :hello, to: 'views#hello' + get :hello, to: "views#hello" end def test_symlinked_layout_is_rendered -- cgit v1.2.3