Module: ActiveDecorator::RSpec
- Defined in:
- lib/active_decorator/rspec.rb,
lib/active_decorator/rspec/version.rb
Constant Summary collapse
- VERSION =
"0.0.4"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.enable(example) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_decorator/rspec.rb', line 8 def self.enable(example) example.extend self base_class = defined?(ApplicationController) ? \ ApplicationController : ActionController::Base controller = Class.new(base_class).new controller.request = ActionController::TestRequest.new ActiveDecorator::ViewContext.current = controller.view_context self end |
Instance Method Details
#decorate(obj) ⇒ Object
20 21 22 23 |
# File 'lib/active_decorator/rspec.rb', line 20 def decorate(obj) ActiveDecorator::Decorator.instance.decorate(obj) obj end |