Skip to content

Commit

Permalink
fix(apimock): timestamps had an invalid format
Browse files Browse the repository at this point in the history
`00:00:00` isn’t a valid filename. Using `00.00.00` instead.

Fixes #57
  • Loading branch information
seriema committed Oct 25, 2015
1 parent a4d4bba commit 024c8de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/scripts/angular-apimock.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ angular.module('apiMock', [])
'-' + pad(date.getUTCMonth() + 1) +
'-' + pad(date.getUTCDate()) +
'T' + pad(date.getUTCHours()) +
':' + pad(date.getUTCMinutes()) +
':' + pad(date.getUTCSeconds()) +
'.' + pad(date.getUTCMinutes()) +
'.' + pad(date.getUTCSeconds()) +
'.' + (date.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) +
'Z';
}
Expand Down
4 changes: 2 additions & 2 deletions test/spec/services/angular-apimock.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,9 @@ describe('Service: apiMock', function () {
it('should serialize date type', function () {
defaultRequest.url = '/api/pokemon';
defaultRequest.params = {
'releaseDate': new Date(Date.UTC(96, 1, 27, 0, 0, 0))
'releaseDate': new Date(Date.UTC(96, 1, 27, 1, 2, 3))
};
defaultExpectPath = '/mock_data/pokemon/releasedate=1996-02-27t00:00:00.000z.get.json';
defaultExpectPath = '/mock_data/pokemon/releasedate=1996-02-27t01.02.03.000z.get.json';

expectHttpSuccess();
});
Expand Down

0 comments on commit 024c8de

Please sign in to comment.