提交 edc9c226 编写于 作者: M Mike Breen 提交者: Pratik Naik

Add tests for assert_template :template

Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
上级 8118fca9
...@@ -12,6 +12,9 @@ def hello_world() render :template => "test/hello_world"; end ...@@ -12,6 +12,9 @@ def hello_world() render :template => "test/hello_world"; end
# a standard template # a standard template
def hello_xml_world() render :template => "test/hello_xml_world"; end def hello_xml_world() render :template => "test/hello_xml_world"; end
# a standard partial
def partial() render :partial => 'test/partial'; end
# a redirect to an internal location # a redirect to an internal location
def redirect_internal() redirect_to "/nothing"; end def redirect_internal() redirect_to "/nothing"; end
...@@ -331,6 +334,26 @@ def test_flash_have_nots ...@@ -331,6 +334,26 @@ def test_flash_have_nots
end end
end end
def test_assert_template_with_partial
get :partial
assert_template :partial => '_partial'
end
def test_assert_template_with_nil
get :nothing
assert_template nil
end
def test_assert_template_with_string
get :hello_world
assert_template 'hello_world'
end
def test_assert_template_with_symbol
get :hello_world
assert_template :hello_world
end
# check if we were rendered by a file-based template? # check if we were rendered by a file-based template?
def test_rendered_action def test_rendered_action
process :nothing process :nothing
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册