Module: Frails::Component::TestHelpers
- Defined in:
- lib/frails/component/test_helpers.rb
Instance Method Summary collapse
Instance Method Details
#controller ⇒ Object
10 11 12 |
# File 'lib/frails/component/test_helpers.rb', line 10 def controller @controller ||= ApplicationController.new.tap { |c| c.request = request } end |
#render_inline(options = {}, locals = {}, &block) ⇒ Object
6 7 8 |
# File 'lib/frails/component/test_helpers.rb', line 6 def render_inline( = {}, locals = {}, &block) Nokogiri::HTML(controller.view_context.render(, locals, &block)) end |
#request ⇒ Object
14 15 16 |
# File 'lib/frails/component/test_helpers.rb', line 14 def request @request ||= ActionDispatch::TestRequest.create end |