Take care of whitespaces and changing the hash syntax
descriptive `assert_template` error when partial wasn't rendered

When `assert_template` is used with the :locals option, and the
partial was not rendered, a method_missing error was raised.
This changes first checks, if the partial actually was rendered
and raises a descriptive error.
partials inside directory work with `assert_template`

previously when a partial was placed inside a directory
(eg. '/dir/_partial'), `assert_template` did not replace
the '_' prefix when looking through rendered tempaltes,
which resulted in an error.

I modified it to replace both, the leading '_' and the last '_'
after a '/'.
Merge pull request #8520 from senny/8516_assert_template_with_locals

Improved `assert_template` when matching :locals with partials