diff options
author | Tony Miller <mcfiredrill@gmail.com> | 2013-08-10 20:58:47 -0700 |
---|---|---|
committer | Tony Miller <mcfiredrill@gmail.com> | 2013-08-10 20:58:47 -0700 |
commit | 82acd0eaaf1eacce4c809cef02d53dd2ea58d341 (patch) | |
tree | 280b84b28160064f00849158ee237a418285c904 /guides/source | |
parent | e5249a7970251ed802dd895963fe9734c4ec1064 (diff) | |
download | rails-82acd0eaaf1eacce4c809cef02d53dd2ea58d341.tar.gz rails-82acd0eaaf1eacce4c809cef02d53dd2ea58d341.tar.bz2 rails-82acd0eaaf1eacce4c809cef02d53dd2ea58d341.zip |
additional note about routes in functional tests for engines [ci skip]
Diffstat (limited to 'guides/source')
-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 9106b6382d..daf2956148 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -721,6 +721,16 @@ get :index, use_route: :blorgh This tells the application that you still want to perform a `GET` request to the `index` action of this controller, just that you want to use the engine's route to get there, rather than the application. +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 ------------------------------ |