<commit_before>import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '../helpers/start-app';

var application;

module('Acceptance: DocumentTitle', {
  beforeEach: function() {
    application = startApp();
  },

  afterEach: function() {
    Ember.run(application, 'destroy');
  }
});

test('static title doesn\'t bubble', function(assert) {
  assert.expect(1);

  visit('/about');
  var router = application.__container__.lookup('router:main');

  andThen(function() {
    assert.equal(router._title, 'About Us', 'It doesn\'t bubble up');
  });
});

test('bubbling title tokens', function(assert) {
  assert.expect(1);

  visit('/team');
  var router = application.__container__.lookup('router:main');

  andThen(function() {
    assert.equal(router._title, 'The Team - My Blog', 'The title token bubbles up');
  });
});

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

  visit('/posts');
  var router = application.__container__.lookup('router:main');

  andThen(function() {
    assert.equal(router._title, 'Ember is omakase - Posts - My Blog');
  });
});<commit_msg>Refactor router lookup in tests<commit_after>import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '../helpers/start-app';

var application, router;

module('Acceptance: DocumentTitle', {
  beforeEach: function() {
    application = startApp();
    router = application.__container__.lookup('router:main');
  },

  afterEach: function() {
    Ember.run(application, 'destroy');
  }
});

test('static title doesn\'t bubble', function(assert) {
  assert.expect(1);

  visit('/about');

  andThen(function() {
    assert.equal(router._title, 'About Us', 'It doesn\'t bubble up');
  });
});

test('bubbling title tokens', function(assert) {
  assert.expect(1);

  visit('/team');

  andThen(function() {
    assert.equal(router._title, 'The Team - My Blog', 'The title token bubbles up');
  });
});

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

  visit('/posts');

  andThen(function() {
    assert.equal(router._title, '<NAME> omakase - Posts - My Blog');
  });
});
{'fraction_non_alphanumeric': 0.17530064754856614, 'fraction_numerical': 0.0027752081406105457, 'mean_word_length': 4.327586206896552, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4138974', 'n_tokens_mistral': 674, 'n_tokens_neox': 657, 'n_words': 163}