Use NameError#name to assert raised error.

This makes the test compatible with other Ruby implementations, which
may implement error messages differently.
Merge pull request #11993 from razielgn/actionview-use-name-to-inspect-error

Use NameError#name to assert raised error.