Permalink
Browse files

Merge pull request #11836 from mcfiredrill/engines-testing-doc

additional note about routes in functional tests for engines [ci skip]
  • Loading branch information...
2 parents fe4b0ee + 82acd0e commit fa836019961b9cf22538b9c7aefa025b06e3f82a @arthurnn arthurnn committed Apr 16, 2014
Showing with 10 additions and 0 deletions.
  1. +10 −0 guides/source/engines.md
View
@@ -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
------------------------------

0 comments on commit fa83601

Please sign in to comment.