lib/action_view/component/test_helpers.rb in actionview-component-1.3.3 vs lib/action_view/component/test_helpers.rb in actionview-component-1.3.4
- old
+ new
@@ -6,10 +6,14 @@
def render_inline(component, **args, &block)
Nokogiri::HTML(controller.view_context.render(component, args, &block))
end
def controller
- @controller ||= ApplicationController.new.tap { |c| c.request = ActionDispatch::TestRequest.create }
+ @controller ||= ApplicationController.new.tap { |c| c.request = request }
+ end
+
+ def request
+ @request ||= ActionDispatch::TestRequest.create
end
def render_component(component, **args, &block)
ActiveSupport::Deprecation.warn(
"`render_component` has been deprecated in favor of `render_inline`, and will be removed in v2.0.0."