1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #17040 from clyfe/patch-1

Explicit route test class
This commit is contained in:
Rafael Mendonça França 2014-10-31 18:57:56 -02:00
commit 487145f871

View file

@ -905,8 +905,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
```