-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from stefanpenner/smoke-test
adding smoke tests to catch initializer logic
- Loading branch information
Showing
20 changed files
with
123 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Ember from 'ember'; | ||
|
||
export default function(helper) { | ||
if (Ember.Helper && Ember.Helper.detect(helper)) { | ||
return helper; | ||
} | ||
|
||
return Ember.HTMLBars.makeBoundHelper(helper); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { default } from 'ember-moment/helpers/ago'; | ||
import agoHelper from 'ember-moment/helpers/ago'; | ||
import makeBoundHelper from 'ember-moment/utils/make-bound-helper'; | ||
|
||
export default makeBoundHelper(agoHelper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { default } from 'ember-moment/helpers/duration'; | ||
import durationHelper from 'ember-moment/helpers/duration'; | ||
import makeBoundHelper from 'ember-moment/utils/make-bound-helper'; | ||
|
||
export default makeBoundHelper(durationHelper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { default } from 'ember-moment/helpers/moment'; | ||
import momentHelper from 'ember-moment/helpers/moment'; | ||
import makeBoundHelper from 'ember-moment/utils/make-bound-helper'; | ||
|
||
export default makeBoundHelper(momentHelper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{ | ||
"name": "ember-moment", | ||
"dependencies": { | ||
"ember": "1.13.3", | ||
"ember": "1.10.0", | ||
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3", | ||
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", | ||
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5", | ||
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", | ||
"ember-qunit": "0.4.1", | ||
"ember-qunit-notifications": "0.0.7", | ||
"ember-resolver": "~0.1.18", | ||
"jquery": "^1.11.1", | ||
"loader.js": "ember-cli/loader.js#3.2.0", | ||
"moment-timezone": "~0.2.5", | ||
"qunit": "~1.17.1" | ||
}, | ||
"resolutions": { | ||
"ember": "release" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Ember from 'ember'; | ||
import { module } from 'qunit'; | ||
import startApp from '../helpers/start-app'; | ||
|
||
let application; | ||
|
||
module('Acceptance: Smoke', { | ||
beforeEach() { | ||
application = startApp(); | ||
}, | ||
afterEach() { | ||
if (application) { | ||
Ember.run(application, 'destroy'); | ||
} | ||
} | ||
}); | ||
|
||
test('moment', (assert) => { | ||
assert.expect(1); | ||
visit('/smoke'); | ||
andThen(function() { | ||
assert.equal(find('.moment-independence-day').text(), 'Jul 04, 1776'); | ||
}); | ||
}); | ||
|
||
test('ago', (assert) => { | ||
assert.expect(1); | ||
visit('/smoke'); | ||
andThen(function() { | ||
assert.equal(find('.ago-now').text(), 'a few seconds ago'); | ||
}); | ||
}); | ||
|
||
test('duration', (assert) => { | ||
assert.expect(1); | ||
visit('/smoke'); | ||
andThen(function() { | ||
assert.equal(find('.duration-seven-minutes').text(), '7 minutes'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
now: new Date(), | ||
usIndependenceDay: new Date(1776, 6, 4, 12, 0, 0) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Ember from 'ember'; | ||
import moment from 'moment'; | ||
|
||
export default Ember.Route.extend({ | ||
setupController: function (controller, model) { | ||
moment.locale('en'); | ||
return this._super(controller, model); | ||
} | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="moment-independence-day">{{moment usIndependenceDay 'MMM DD, YYYY'}}</div> | ||
<div class="ago-now">{{ago now}}</div> | ||
<div class="duration-seven-minutes">{{duration 420000}}</div> |