Fix controller route lookup for Rails 4.2

Rails-4.2 splits named_routes.helpers to path_helpers and url_helpers.
And add route_defined? method to NamedRouteCollection.
Merge pull request #1142 from joker1007/adapt_named_route_helpers_split

Fix controller spec fails on edge Rails
Try Rails 4.2 beta
Workaround issue alexrothenberg/ammeter#42

Rails 4.2 has deprecated the `capture` method as it is not thread safe.
This shim worksaround the open issue on Ammeter which calls out to
`capture`.

I have no idea if this is thread safe or not.:grimacing: :unamused: