Skip to content

Commit

Permalink
Rearrange integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmun committed Dec 3, 2016
1 parent 61c7534 commit 4579406
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 92 deletions.
20 changes: 20 additions & 0 deletions tests/integration/ember-string-extensions-test.js
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from "ember-qunit";

module("Integration | Ember.String extensions");

test("pluralize", function(assert) {
assert.expect(3);

assert.equal(Ember.String.pluralize('word'), 'words');
assert.equal(Ember.String.pluralize('ox'), 'oxen');
assert.equal(Ember.String.pluralize('octopus'), 'octopi');
});

test("singularize", function(assert) {
assert.expect(3);

assert.equal(Ember.String.singularize('words'), 'word');
assert.equal(Ember.String.singularize('oxen'), 'ox');
assert.equal(Ember.String.singularize('octopi'), 'octopus');
});
72 changes: 72 additions & 0 deletions tests/integration/helpers/ember-inflector-test.js
@@ -0,0 +1,72 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ember-inflector', 'Integration | Helpers', {
integration: true
});

test("singularize", function(assert) {
this.set('plural', 'octopi');
this.render(hbs`{{singularize plural}}`);
assert.equal(this.$().text(), 'octopus');
});

test("pluralize - single arg", function(assert) {
this.set('singular', 'ox');
this.render(hbs`{{pluralize singular}}`);
assert.equal(this.$().text(), 'oxen');
});

test("pluralize - count 1", function(assert) {
this.set('singular', 'opossum');
this.render(hbs`{{pluralize 1 singular}}`);
assert.equal(this.$().text(), '1 opossum');
});

test("pluralize - count 2", function(assert) {
this.set('singular', 'ocelot');
this.render(hbs`{{pluralize 2 singular}}`);
assert.equal(this.$().text(), '2 ocelots');
});

test("pluralize - bound count 1", function(assert) {
this.set('count', 1);
this.set('singular', 'orange');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '1 orange');
});

test("pluralize - bound count 1.0 float", function(assert) {
this.set('count', 1.0);
this.set('singular', 'owl');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '1 owl');
});

test("pluralize - bound count 1.5 float", function(assert) {
this.set('count', 1.5);
this.set('singular', 'owl');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '1.5 owls');
});

test("pluralize - bound count 1.0 string", function(assert) {
this.set('count', '1.0');
this.set('singular', 'owl');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '1.0 owl');
});

test("pluralize - bound count 1.5 string", function(assert) {
this.set('count', '1.5');
this.set('singular', 'owl');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '1.5 owls');
});

test("pluralize - bound count 2", function(assert) {
this.set('count', 2);
this.set('singular', 'omnivore');
this.render(hbs`{{pluralize count singular}}`);
assert.equal(this.$().text(), '2 omnivores');
});
Empty file removed tests/unit/.gitkeep
Empty file.
92 changes: 0 additions & 92 deletions tests/unit/integration-test.js

This file was deleted.

0 comments on commit 4579406

Please sign in to comment.