Permalink
Browse files

tests for upload and remove

  • Loading branch information...
1 parent 3782e20 commit b0c1509992d90de6bf9657fe030825d35b8f6cc2 @madhums committed Aug 25, 2012
Showing with 12 additions and 11 deletions.
  1. +12 −11 test/test.js
View
@@ -2,14 +2,15 @@ var Imager = require('../index')
, should = require('should')
, imagerConfig = require('./imager')
, imager = new Imager(imagerConfig, 'Rackspace')
+ , filesToRemove
describe('Imager', function () {
describe('Single image from disk', function () {
it('should upload to rackspace', function (done) {
- imager.upload(__dirname+'/fixtures/single.jpg', function(err, files, cdnUri){
+ imager = new Imager(imagerConfig, 'Rackspace')
+ imager.upload(__dirname+'/fixtures/single.jpg', function(err, cdnUri, files){
files.should.be.a('object')
files.length.should.be.equal(1)
- console.log(files)
done()
}, 'items')
})
@@ -18,23 +19,23 @@ describe('Imager', function () {
describe('Multiple images from disk', function () {
it('should upload to rackspace', function (done) {
var arr = [__dirname+'/fixtures/single.jpg', __dirname+'/fixtures/multiple-3.png']
- imager.upload(arr, function(err, files, cdnUri){
+ imager = new Imager(imagerConfig, 'Rackspace')
+ imager.upload(arr, function(err, cdnUri, files){
files.should.be.a('object')
files.length.should.be.equal(2)
- console.log(files)
+ filesToRemove = files
done()
}, 'items')
})
})
- /*describe('Single image from remote url', function () {
- it('should upload to rackspace', function (done) {
- imager.uploadRemoteImage('http://www.google.co.in/images/srpr/logo3w.png', function(err, files, cdnUri){
- files.should.be.a('object')
- files.length.should.be.equal(1)
- console.log(files)
+ describe('Remove images', function () {
+ it('should remove the images from Rackspace', function (done) {
+ imager = new Imager(imagerConfig, 'Rackspace')
+ imager.remove(filesToRemove, function(err){
+ should.not.exist(err)
done()
}, 'items')
})
- })*/
+ })
})

0 comments on commit b0c1509

Please sign in to comment.