diff options
author | Arthur Nogueira Neves <arthurnn@gmail.com> | 2014-04-16 10:49:26 -0400 |
---|---|---|
committer | Arthur Nogueira Neves <arthurnn@gmail.com> | 2014-04-16 10:49:26 -0400 |
commit | fa836019961b9cf22538b9c7aefa025b06e3f82a (patch) | |
tree | a1afe99d146752b358a683b7634d068c77d1397c /guides | |
parent | fe4b0eee05f59831e1468ed50f55fbad0ce11e1d (diff) | |
parent | 82acd0eaaf1eacce4c809cef02d53dd2ea58d341 (diff) | |
download | rails-fa836019961b9cf22538b9c7aefa025b06e3f82a.tar.gz rails-fa836019961b9cf22538b9c7aefa025b06e3f82a.tar.bz2 rails-fa836019961b9cf22538b9c7aefa025b06e3f82a.zip |
Merge pull request #11836 from mcfiredrill/engines-testing-doc
additional note about routes in functional tests for engines [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/engines.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/guides/source/engines.md b/guides/source/engines.md index bbd63bb892..8f9ba0995f 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -1052,6 +1052,16 @@ This tells the application that you still want to perform a `GET` request to the `index` action of this controller, but you want to use the engine's route to get there, rather than the application's one. +Another way to do this is to assign the `@routes` instance variable to `Engine.routes` in your test setup: + +```ruby +setup do + @routes = Engine.routes +end +``` + +This will also ensure url helpers for the engine will work as expected in your tests. + Improving engine functionality ------------------------------ |