mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
commit
487145f871
1 changed files with 4 additions and 2 deletions
|
@ -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:
|
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
|
```ruby
|
||||||
test "should route to article" do
|
class ArticleRoutesTest < ActionController::TestCase
|
||||||
assert_routing '/articles/1', {controller: "articles", action: "show", id: "1"}
|
test "should route to article" do
|
||||||
|
assert_routing '/articles/1', { controller: "articles", action: "show", id: "1" }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue