emberjs/ember.js — pull request #4532 by ghedamat (2014-03-15 04:31:09+00:00)
Title: [BUGFIX] When selecting controller for view prioritize controllerName over controller matching template or route name

When specifying `controllerName` in a route, if a controller exists with a name matching the template name, it will be ignored.

This seems to go against the documentation for `controllerName` which states that the specified `controllerName` will be "used as the controller for the view being rendered by the route."

We have added a test for this particular case. All existing tests pass unchanged.

The new priority for looking up the controller passed to the view is as follows:
* use controller explicitly passed in `render`
* use controller based on `controllerName`
* use controller based on `templateName`
* use controller based on `routeName`