mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
Merge pull request #852 from jamesbloomer/826-fix-image-upload-tests-on-windows
This commit is contained in:
commit
e9015fdb03
1 changed files with 12 additions and 0 deletions
|
@ -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.jpg').yields(true);
|
||||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE-1.jpg').yields(false);
|
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) {
|
sinon.stub(res, 'send', function(data) {
|
||||||
data.should.equal('/content/images/2013/Sep/IMAGE-1.jpg');
|
data.should.equal('/content/images/2013/Sep/IMAGE-1.jpg');
|
||||||
return done();
|
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-3.jpg').yields(true);
|
||||||
fs.exists.withArgs('content/images/2013/Sep/IMAGE-4.jpg').yields(false);
|
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) {
|
sinon.stub(res, 'send', function(data) {
|
||||||
data.should.equal('/content/images/2013/Sep/IMAGE-4.jpg');
|
data.should.equal('/content/images/2013/Sep/IMAGE-4.jpg');
|
||||||
return done();
|
return done();
|
||||||
|
|
Loading…
Reference in a new issue