method

assert_template

rails latest stable - Class: ActionController::Assertions::ResponseAssertions

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

assert_template(options = {}, message = nil)
public

Asserts that the request was rendered with the appropriate template file or partials

Examples

  # assert that the "new" view template was rendered
  assert_template "new"

  # assert that the "new" view template was rendered with Symbol
  assert_template :new

  # assert that the "_customer" partial was rendered twice
  assert_template :partial => '_customer', :count => 2

  # assert that no partials were rendered
  assert_template :partial => false

1Note

As of v2.3.4 you can use Symbols

hardbap ยท Nov 4, 20091 thank

This commit fixes using a Symbol with assert_template

http://github.com/rails/rails/commit/f383a4aa333cd8a99003eb1bdbb27b6fdea1056c

assert_template :new # works in 2.3.4