Testing Routes

Testing routes can be done both via acceptance or unit tests. Acceptance tests
will likely provide better coverage for routes because routes are typically used
to perform transitions and load data, both of which are tested more easily in
full context rather than isolation.

That being said, sometimes it is important to unit test your routes. For example,
let's say we'd like to have an alert that can be triggered from anywhere within
our application. The alert function displayAlert should be put into the
ApplicationRoute because all actions and events bubble up to it from
sub-routes and controllers.

By default, Ember CLI does not generate a file for its application route. To
extend the behavior of the ember application route we will run the command
ember generate route application. Ember CLI does however generate an application
template, so when asked whether we want to overwrite app/templates/application.hbs
we will answer 'n'.

In this route we've separated our concerns:
The action displayAlert contains the code that is called when the action is
received, and the private function _displayAlert performs the work. While not
necessarily obvious here because of the small size of the functions, separating
code into smaller chunks (or "concerns"), allows it to be more readily isolated
for testing, which in turn allows you to catch bugs more easily.