Skip to Content Skip to Search

class ActionView::TestCase::Behavior::RenderedViewsCollection

Need to experiment if this priority is the best one: rendered => output_buffer

Public class methods

Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 306
def initialize
  @rendered_views ||= Hash.new { |hash, key| hash[key] = [] }
end

Public instance methods

Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 310
def add(view, locals)
  @rendered_views[view] ||= []
  @rendered_views[view] << locals
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 315
def locals_for(view)
  @rendered_views[view]
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 319
def rendered_views
  @rendered_views.keys
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 323
def view_rendered?(view, expected_locals)
  locals_for(view).any? do |actual_locals|
    expected_locals.all? { |key, value| value == actual_locals[key] }
  end
end

Definition files