提交 c90572e3 编写于 作者: J Jeremy Kemper

Use instance_eval instead of adding an accessor to the class

上级 35fa0073
......@@ -146,8 +146,7 @@ class LayoutExceptionRaised < ActionController::TestCase
def test_exception_raised_when_layout_file_not_found
@controller = SetsNonExistentLayoutFile.new
get :hello
@response.template.class.module_eval { attr_accessor :exception }
assert_equal ActionView::MissingTemplate, @response.template.exception.class
assert_kind_of ActionView::MissingTemplate, @response.template.instance_eval { @exception }
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册