class ActionView::TestCase::Behavior::RenderedViewsCollection
def add(view, locals)
def add(view, locals) @rendered_views[view] ||= [] @rendered_views[view] << locals end
def initialize
def initialize @rendered_views ||= Hash.new { |hash, key| hash[key] = [] } end
def locals_for(view)
def locals_for(view) @rendered_views[view] end
def rendered_views
def rendered_views @rendered_views.keys end
def view_rendered?(view, expected_locals)
def view_rendered?(view, expected_locals) locals_for(view).any? do |actual_locals| expected_locals.all? {|key, value| value == actual_locals[key] } end end