mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Added notes about decorator specs that might live outside spec/decorators/
This commit is contained in:
parent
358e93953c
commit
75ab9bb8c0
1 changed files with 4 additions and 2 deletions
|
@ -250,8 +250,10 @@ end
|
|||
### Integration with RSpec
|
||||
|
||||
Using the provided generator, Draper will place specs for your new decorator in `spec/decorators/`.
|
||||
By default, specs in `spec/decorators` will be tagged as `type => :decorator`. Any spec tagged as `decorator`
|
||||
will run `ApplicationController.new.set_current_view_context` which makes helpers available to the decorator.
|
||||
|
||||
By default, specs in `spec/decorators` will be tagged as `type => :decorator`. Any spec tagged as `decorator` will run `ApplicationController.new.set_current_view_context` which makes helpers available to the decorator.
|
||||
|
||||
If your decorator specs live somewhere else, which they shouldn't, make sure to tag them with `type => :decorator`. If you don't tag them, Draper's helpers won't be available to your decorator while testing.
|
||||
|
||||
Note: If you're using Spork, you need to `require 'draper/rspec_integration'` in your Spork.prefork block.
|
||||
|
||||
|
|
Loading…
Reference in a new issue