Module: AmberComponent::TestHelper
- Included in:
- MinitestTestCase, ApplicationComponentTestCase
- Defined in:
- lib/amber_component/test_helper.rb
Overview
Provides assertions for the rendered HTML of components.
Instance Method Summary collapse
- #document ⇒ Nokogiri::HTML (also: #doc, #html)
- #render(content = nil) ⇒ Nokogiri::HTML (also: #render_inline)
Instance Method Details
#document ⇒ Nokogiri::HTML Also known as: doc, html
19 20 21 |
# File 'lib/amber_component/test_helper.rb', line 19 def document ::Nokogiri::HTML.fragment(@rendered_content) end |
#render(content = nil) ⇒ Nokogiri::HTML Also known as: render_inline
27 28 29 30 31 |
# File 'lib/amber_component/test_helper.rb', line 27 def render(content = nil) @page = nil @rendered_content = content || yield document end |