updating readme for use in Engine Apps
This commit is contained in:
parent
57a514133b
commit
c50109afb3
|
@ -379,6 +379,15 @@ In your `Spork.prefork` block of `spec_helper.rb`, add this:
|
||||||
require 'draper/test/rspec_integration'
|
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
|
### Isolated Tests
|
||||||
|
|
||||||
In tests, Draper needs to build a view context to access helper methods. By
|
In tests, Draper needs to build a view context to access helper methods. By
|
||||||
|
|
Loading…
Reference in New Issue