Class: ActionView::TestCase::Behavior::RenderedViewsCollection
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionview/lib/action_view/test_case.rb |
Overview
Need to experiment if this priority is the best one: rendered => output_buffer
Class Method Summary
- .new ⇒ RenderedViewsCollection constructor
Instance Method Summary
Constructor Details
.new ⇒ RenderedViewsCollection
# File 'actionview/lib/action_view/test_case.rb', line 136
def initialize @rendered_views ||= Hash.new { |hash, key| hash[key] = [] } end
Instance Method Details
#add(view, locals)
[ GitHub ]#locals_for(view)
[ GitHub ]#rendered_views
[ GitHub ]# File 'actionview/lib/action_view/test_case.rb', line 149
def rendered_views @rendered_views.keys end
#view_rendered?(view, expected_locals) ⇒ Boolean
# File 'actionview/lib/action_view/test_case.rb', line 153
def view_rendered?(view, expected_locals) locals_for(view).any? do |actual_locals| expected_locals.all? { |key, value| value == actual_locals[key] } end end