下面是一段代码片段#assert_template。 expected_layout未定义!什么设置@layouts。
msg = build_message(message,
"expecting layout <?> but action rendered <?>",
expected_layout, @layouts.keys)
case layout = options[:layout]
when String
assert(@layouts.include?(expected_layout), msg)
我正在尝试断言在控制器操作中动态定义的布局。规范说......
response.should render_template(:layout => "bare", :partial => "show")
我得到了
NameError: undefined local variable or method `expected_layout'