stefanpenner/ember-app-kit — pull request #363 by FilmKnurd (2013-12-07 21:34:51+00:00)
Title: Adds test helper for asserting a given route is active

I found this: http://stackoverflow.com/a/15020704 to be useful for verifying route transitions. After a visit() or click(), you can use this helper to verify the end state of a redirect() or transitionTo().

**Usage**:
```javascript
test( "some path route redirects to posts/new", function() {
visit( '/some/path' );

andThen( function() {
currentRoute( 'posts.new', 'posts/new route is active' );
});

});
```
It uses the isolated container to get the main router and, from that, the current active handler. Given a route name, it asserts that the provided name is equal to the route name of the active handler.

I thought about requiring the App to be injected, and then just grabbing the currentPath:
```javascript
App.__container__.lookup( 'controller:application' ).get( 'currentPath' )
```
But, I liked being able to just pass in the name of a route.