aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorClaudius Nicolae <claudius.nicolae@gmail.com>2014-09-24 01:15:27 +0300
committerClaudius Nicolae <claudius.nicolae@gmail.com>2014-09-24 01:15:27 +0300
commitb36f123d09e947fa2e1d35ffb0e973b028673d92 (patch)
tree2db55f9f60b69ed8c82b3f73f1327dc647c97fa7 /guides
parent4e8ea13ba1a0870905a46fac5f232d9f41eef8a4 (diff)
downloadrails-b36f123d09e947fa2e1d35ffb0e973b028673d92.tar.gz
rails-b36f123d09e947fa2e1d35ffb0e973b028673d92.tar.bz2
rails-b36f123d09e947fa2e1d35ffb0e973b028673d92.zip
Explicit route test class
shows the class that the test must extend in order to have the assert_routing method available
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md6
1 files 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
```