Permalink
Browse files

Add request and params support to the Draper spec harness

  • Loading branch information...
1 parent 9cd57e0 commit 58e9893838d012a6f1cd38f5d29d8da2d23b1204 @cheald committed May 5, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/draper/rspec_integration.rb
View
3 lib/draper/rspec_integration.rb 100644 → 100755
@@ -14,6 +14,9 @@ module DecoratorExampleGroup
config.around do |example|
if :decorator == example.metadata[:type]
ApplicationController.new.set_current_view_context
+ Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new
+ Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request
+ Draper::ViewContext.current.params ||= {}
end
example.call
end

0 comments on commit 58e9893

Please sign in to comment.