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

var application;

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

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

test('the default configuration works', function(assert) {
  assert.expect(1);
  visit('/posts');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'My App | Posts');
  });
});

test('the replace attribute works', function(assert) {
  assert.expect(1);
  visit('/about');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'About My App');
  });
});

test('custom separators work', function(assert) {
  assert.expect(1);
  visit('/about/authors');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'About My App > Authors');
  });
});

test('custom separators are inherited', function(assert) {
  assert.expect(1);
  visit('/about/authors/profile');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'About My App > Authors > Profile');
  });
});

test('multiple components in a row work', function(assert) {
  assert.expect(1);
  visit('/posts/rails-is-omakase');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'My App | Posts | Rails is Omakase');
  });
});

test('the prepend declaration works', function(assert) {
  assert.expect(1);
  visit('/authors/tomster');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'My App | Tomster < Authors');
  });
});

test('replace nested in prepends work', function(assert) {
  assert.expect(1);
  visit('/hollywood');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'Hollywood ★ Stars everywhere');
  });
});

test('multitoken titles work', function(assert) {
  assert.expect(1);
  visit('/feeds/tomster');

  andThen(function() {
    assert.equal(findWithAssert('title', 'head').text(), 'Tomster (@tomster)');
  });
});<commit_msg>fix failing tests caused by testem<commit_after>import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '../helpers/start-app';

var application;

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

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

// Testem appends progress to the title...
// and there's no way to stop this at the moment
function title() {
  return findWithAssert('title', 'head').text().replace(document.title, '').replace(/^\s+/, '');
}

test('the default configuration works', function(assert) {
  assert.expect(1);
  visit('/posts');

  andThen(function() {
    assert.equal(title(), 'My App | Posts');
  });
});

test('the replace attribute works', function(assert) {
  assert.expect(1);
  visit('/about');

  andThen(function() {
    assert.equal(title(), 'About My App');
  });
});

test('custom separators work', function(assert) {
  assert.expect(1);
  visit('/about/authors');

  andThen(function() {
    assert.equal(title(), 'About My App > Authors');
  });
});

test('custom separators are inherited', function(assert) {
  assert.expect(1);
  visit('/about/authors/profile');

  andThen(function() {
    assert.equal(title(), 'About My App > Authors > Profile');
  });
});

test('multiple components in a row work', function(assert) {
  assert.expect(1);
  visit('/posts/rails-is-omakase');

  andThen(function() {
    assert.equal(title(), 'My App | Posts | Rails is Omakase');
  });
});

test('the prepend declaration works', function(assert) {
  assert.expect(1);
  visit('/authors/tomster');

  andThen(function() {
    assert.equal(title(), 'My App | Tomster < Authors');
  });
});

test('replace nested in prepends work', function(assert) {
  assert.expect(1);
  visit('/hollywood');

  andThen(function() {
    assert.equal(title(), 'Hollywood ★ Stars everywhere');
  });
});

test('multitoken titles work', function(assert) {
  assert.expect(1);
  visit('/feeds/tomster');

  andThen(function() {
    assert.equal(title(), 'Tomster (@tomster)');
  });
});
{'fraction_non_alphanumeric': 0.196522153406384, 'fraction_numerical': 0.003811338732729871, 'mean_word_length': 4.53957783641161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4016026', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1308, 'n_words': 293}