Skip to content

Commit

Permalink
Add failing test for #5
Browse files Browse the repository at this point in the history
  • Loading branch information
kimroen committed Mar 7, 2015
1 parent 78be872 commit 2bed8f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/acceptance/document-title-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ test('dynamic title based on a model', function(assert) {
assert.equal(router._title, 'Ember is omakase - Posts - My Blog');
});
});

test('dynamic title based on route attributes', function(assert) {
assert.expect(1);

visit('/friendship-status');

andThen(function() {
assert.equal(router._title, 'We are friends - My Blog');
});
});
1 change: 1 addition & 0 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Router.map(function() {
this.resource('posts', function() {});
this.route('about');
this.route('team');
this.route('friendship-status');
});

export default Router;
9 changes: 9 additions & 0 deletions tests/dummy/app/routes/friendship-status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Ember from 'ember';

export default Ember.Route.extend({
status: 'friends',

titleToken: function(model) {
return 'We are ' + this.get('status');
}
});

0 comments on commit 2bed8f2

Please sign in to comment.