Skip to content

Commit

Permalink
add test to check for conversion of spaces TryGhost#635
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbloomer committed Sep 29, 2013
1 parent 13ff3e1 commit b77318f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 0 additions & 4 deletions core/server/controllers/storage/localfilesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,4 @@ localfilesystem = {
}
};

// TODO
// basename = path.basename(req.files.uploadimage.name, ext).replace(/[\W]/gi, '_');


module.exports = localfilesystem;
9 changes: 9 additions & 0 deletions core/test/unit/storage_localfilesystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ describe('Local File System Storage', function() {
});
});

it('should send correct path to image when original file has spaces', function(done) {
var date = new Date(2013, 8, 7, 21, 24).getTime();
image.name = 'AN IMAGE.jpg';
localfilesystem.save(date, image, 'GHOSTURL').then(function(url) {
url.should.equal('GHOSTURL/content/images/2013/Sep/AN_IMAGE.jpg');
return done();
});
});

it('should send correct path to image when date is in Jan 2014', function(done) {
// Jan 1 2014 12:00
var date = new Date(2014, 0, 1, 12).getTime()
Expand Down

0 comments on commit b77318f

Please sign in to comment.