diff options
| author | mo khan <mo@mokhan.ca> | 2014-11-29 23:19:44 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-11-29 23:19:44 -0700 |
| commit | c0720d6aac55204d8ca10941b8e1e2c9eaa29917 (patch) | |
| tree | 77e537b8eaaaa7546f48a9a439e00b612945660e | |
| parent | 73ba3927f608f3816cb4036b4dca07bd10864a1f (diff) | |
add test for formatted date.
| -rw-r--r-- | app/helpers/formatted-date.js | 4 | ||||
| -rw-r--r-- | tests/unit/helpers/formatted-date-test.js | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/formatted-date.js b/app/helpers/formatted-date.js index e33171d..ee2c7bb 100644 --- a/app/helpers/formatted-date.js +++ b/app/helpers/formatted-date.js @@ -1,8 +1,8 @@ /* global moment:true */ import Ember from 'ember'; -export function formattedDate(date, format) { - return moment(date).format(format); +export function formattedDate(date) { + return moment(date).format('MMM Do, YYYY [at] h:mm'); } export default Ember.Handlebars.makeBoundHelper(formattedDate); diff --git a/tests/unit/helpers/formatted-date-test.js b/tests/unit/helpers/formatted-date-test.js index 93cc142..42004a2 100644 --- a/tests/unit/helpers/formatted-date-test.js +++ b/tests/unit/helpers/formatted-date-test.js @@ -4,8 +4,8 @@ import { module('FormattedDateHelper'); -// Replace this with your real tests. -test('it works', function() { - var result = formattedDate(42); - ok(result); +test('it renders a friendly date to display', function() { + var date = new Date('2014-08-02T02:30:57.182Z'); + var result = formattedDate(date); + equal(result, 'Aug 1st, 2014 at 8:30'); }); |
