mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
Merge pull request #852 from jamesbloomer/826-fix-image-upload-tests-on-windows
This commit is contained in:
commit
e9015fdb03
@ -119,6 +119,11 @@ describe('Admin Controller', function() {
|
||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE.jpg').yields(true);
|
||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE-1.jpg').yields(false);
|
||||
|
||||
// if on windows need to setup with back slashes
|
||||
// doesn't hurt for the test to cope with both
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE.jpg').yields(true);
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-1.jpg').yields(false);
|
||||
|
||||
sinon.stub(res, 'send', function(data) {
|
||||
data.should.equal('/content/images/2013/Sep/IMAGE-1.jpg');
|
||||
return done();
|
||||
@ -136,6 +141,13 @@ describe('Admin Controller', function() {
|
||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE-3.jpg').yields(true);
|
||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE-4.jpg').yields(false);
|
||||
|
||||
// windows setup
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE.jpg').yields(true);
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-1.jpg').yields(true);
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-2.jpg').yields(true);
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-3.jpg').yields(true);
|
||||
fs.exists.withArgs('content\\images\\2013\\Sep\\IMAGE-4.jpg').yields(false);
|
||||
|
||||
sinon.stub(res, 'send', function(data) {
|
||||
data.should.equal('/content/images/2013/Sep/IMAGE-4.jpg');
|
||||
return done();
|
||||
|
Loading…
Reference in New Issue
Block a user