From 82acd0eaaf1eacce4c809cef02d53dd2ea58d341 Mon Sep 17 00:00:00 2001 From: Tony Miller Date: Sat, 10 Aug 2013 20:58:47 -0700 Subject: additional note about routes in functional tests for engines [ci skip] --- guides/source/engines.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'guides/source') 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 ------------------------------ -- cgit v1.2.3