aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/url_helper_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2018-09-25 09:27:37 -0700
committerGitHub <noreply@github.com>2018-09-25 09:27:37 -0700
commit6d698fdb070f4134c1795e8befb4e4c5e29a682f (patch)
treeccbaae1d82da6abfc99e151752a557a99da83dfc /actionview/test/template/url_helper_test.rb
parent4f12139a22f70ff0abc1709b8888011f8bfee42c (diff)
parent3301804ff6abcd5aae06cc5acbb82bc6a472f008 (diff)
downloadrails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.tar.gz
rails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.tar.bz2
rails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.zip
Merge pull request #33973 from rails/remove-catch-all
Remove deprecated catch-all route in the AV tests
Diffstat (limited to 'actionview/test/template/url_helper_test.rb')
-rw-r--r--actionview/test/template/url_helper_test.rb44
1 files changed, 33 insertions, 11 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb
index 7b77bae30d..6db9eb3be1 100644
--- a/actionview/test/template/url_helper_test.rb
+++ b/actionview/test/template/url_helper_test.rb
@@ -704,7 +704,7 @@ end
class UrlHelperControllerTest < ActionController::TestCase
class UrlHelperController < ActionController::Base
- test_routes do
+ ROUTES = test_routes do
get "url_helper_controller_test/url_helper/show/:id",
to: "url_helper_controller_test/url_helper#show",
as: :show
@@ -768,6 +768,11 @@ class UrlHelperControllerTest < ActionController::TestCase
helper_method :override_url_helper_path
end
+ def setup
+ super
+ @routes = UrlHelperController::ROUTES
+ end
+
tests UrlHelperController
def test_url_for_shows_only_path
@@ -828,7 +833,7 @@ class UrlHelperControllerTest < ActionController::TestCase
end
class TasksController < ActionController::Base
- test_routes do
+ ROUTES = test_routes do
resources :tasks
end
@@ -850,6 +855,11 @@ end
class LinkToUnlessCurrentWithControllerTest < ActionController::TestCase
tests TasksController
+ def setup
+ super
+ @routes = TasksController::ROUTES
+ end
+
def test_link_to_unless_current_to_current
get :index
assert_equal "tasks\ntasks", @response.body
@@ -882,7 +892,7 @@ class Session
end
class WorkshopsController < ActionController::Base
- test_routes do
+ ROUTES = test_routes do
resources :workshops do
resources :sessions
end
@@ -905,7 +915,7 @@ class WorkshopsController < ActionController::Base
end
class SessionsController < ActionController::Base
- test_routes do
+ ROUTES = test_routes do
resources :workshops do
resources :sessions
end
@@ -932,6 +942,11 @@ class SessionsController < ActionController::Base
end
class PolymorphicControllerTest < ActionController::TestCase
+ def setup
+ super
+ @routes = WorkshopsController::ROUTES
+ end
+
def test_new_resource
@controller = WorkshopsController.new
@@ -946,6 +961,20 @@ class PolymorphicControllerTest < ActionController::TestCase
assert_equal %{/workshops/1\n<a href="/workshops/1">Workshop</a>}, @response.body
end
+ def test_current_page_when_options_does_not_respond_to_to_hash
+ @controller = WorkshopsController.new
+
+ get :edit, params: { id: 1 }
+ assert_equal "false", @response.body
+ end
+end
+
+class PolymorphicSessionsControllerTest < ActionController::TestCase
+ def setup
+ super
+ @routes = SessionsController::ROUTES
+ end
+
def test_new_nested_resource
@controller = SessionsController.new
@@ -966,11 +995,4 @@ class PolymorphicControllerTest < ActionController::TestCase
get :edit, params: { workshop_id: 1, id: 1, format: "json" }
assert_equal %{/workshops/1/sessions/1.json\n<a href="/workshops/1/sessions/1.json">Session</a>}, @response.body
end
-
- def test_current_page_when_options_does_not_respond_to_to_hash
- @controller = WorkshopsController.new
-
- get :edit, params: { id: 1 }
- assert_equal "false", @response.body
- end
end