Fix cases where the wrong name is passed to `Formatter#generate`

These are currently working "by accident" because `match_route` does not check
that the name is valid.
Deprecate passing an invalid name to `Formatter#generate`

The internal tests that (incorrectly) relied on this were already fixed in
938d130. However, we cannot simply fix this bug because the guides prior to
b7b9e92 recommended a workaround that relies on this buggy behavior.

Reference #17453
Deprecate `use_route` in controller tests

Reference #17453
Don't show the warning if we're already raising the error anyway

If the route set is empty, or if none of the routes matches with a score > 0,
there is no point showing the deprecation message because we are already be
raising the `ActionController::UrlGenerationError` mentioned in the warning.

In this case it is the expected behavior and the user wouldn't have to take any
actions.
Merge pull request #17725 from chancancode/deprecate_use_route

Deprecate use route