需要实验一下这种优先级是否最佳:rendered => output_buffer
方法
- A
- L
- N
- R
- V
类公共方法
new() 链接
源代码:显示 | 在 GitHub 上
# File actionview/lib/action_view/test_case.rb, line 306 def initialize @rendered_views ||= Hash.new { |hash, key| hash[key] = [] } end
实例公共方法
add(view, locals) 链接
源代码:显示 | 在 GitHub 上
# File actionview/lib/action_view/test_case.rb, line 310 def add(view, locals) @rendered_views[view] ||= [] @rendered_views[view] << locals end
locals_for(view) 链接
源代码:显示 | 在 GitHub 上
# File actionview/lib/action_view/test_case.rb, line 315 def locals_for(view) @rendered_views[view] end
rendered_views() 链接
源代码:显示 | 在 GitHub 上
# File actionview/lib/action_view/test_case.rb, line 319 def rendered_views @rendered_views.keys end
view_rendered?(view, expected_locals) 链接
源代码:显示 | 在 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