lib/action_view/component/test_helpers.rb in actionview-component-1.1.0 vs lib/action_view/component/test_helpers.rb in actionview-component-1.2.0
- old
+ new
@@ -1,11 +1,19 @@
# frozen_string_literal: true
module ActionView
module Component
module TestHelpers
- def render_component(component, &block)
- Nokogiri::HTML(component.render_in(ApplicationController.new.view_context, &block))
+ def render_inline(component, **args, &block)
+ Nokogiri::HTML(ApplicationController.new.view_context.render(component, args, &block))
+ 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."
+ )
+
+ render_inline(component, args, &block)
end
end
end
end