From c50109afb39bcb61c06121cfe1afc011f21aebbf Mon Sep 17 00:00:00 2001 From: spodlecki Date: Mon, 13 Jul 2015 07:16:43 -0500 Subject: [PATCH] updating readme for use in Engine Apps --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 80009a5..21e6562 100644 --- a/README.md +++ b/README.md @@ -379,6 +379,15 @@ In your `Spork.prefork` block of `spec_helper.rb`, add this: require 'draper/test/rspec_integration' ``` +#### Custom Draper Controller ViewContext +If running tests in an engine setting with a controller other than "ApplicationController," set a custom controller in `spec_helper.rb` + +```ruby +config.before(:each, type: :decorator) do |example| + Draper::ViewContext.controller = ExampleEngine::CustomRootController.new +end +``` + ### Isolated Tests In tests, Draper needs to build a view context to access helper methods. By