From b36f123d09e947fa2e1d35ffb0e973b028673d92 Mon Sep 17 00:00:00 2001 From: Claudius Nicolae Date: Wed, 24 Sep 2014 01:15:27 +0300 Subject: [PATCH] Explicit route test class shows the class that the test must extend in order to have the assert_routing method available --- guides/source/testing.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guides/source/testing.md b/guides/source/testing.md index 29724ae011..f6baccb105 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -904,8 +904,10 @@ Testing Routes Like everything else in your Rails application, it is recommended that you test your routes. An example test for a route in the default `show` action of `Articles` controller above should look like: ```ruby -test "should route to article" do - assert_routing '/articles/1', {controller: "articles", action: "show", id: "1"} +class ArticleRoutesTest < ActionController::TestCase + test "should route to article" do + assert_routing '/articles/1', { controller: "articles", action: "show", id: "1" } + end end ```