Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[test] Working snapshots create test

  • Loading branch information...
commit 3cd8b13afd06c74d3289409794fcfa17711c7237 1 parent 7f292c8
@jfhbrook jfhbrook authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 node.js/test/commands/snapshots-test.js
View
15 node.js/test/commands/snapshots-test.js
@@ -1,6 +1,7 @@
var vows = require('vows'),
assert = require('assert'),
nock = require('nock'),
+ path = require('path'),
makeApiCall = require('../macros').makeApiCall;
vows.describe('snapshots').addBatch(makeApiCall(
@@ -10,9 +11,7 @@ vows.describe('snapshots').addBatch(makeApiCall(
.get('/apps/tester/myApp/snapshots')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
-))
-// TODO: Snapshots create. Needs a file as a fixture.
-.addBatch(makeApiCall(
+)).addBatch(makeApiCall(
'snapshots destroy myApp v0.0.0',
function setup () {
nock('http://api.mockjitsu.com')
@@ -26,4 +25,14 @@ vows.describe('snapshots').addBatch(makeApiCall(
.post('/apps/tester/myApp/snapshots/v0.0.0/activate', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
+)).addBatch(makeApiCall(
+ [
+ 'snapshots create myApp v0.0.0',
+ path.join(__dirname, '../fixtures/snapshot.tgz')
+ ].join(' '),
+ function setup () {
+ nock('http://api.mockjitsu.com')
+ .post('/apps/tester/myApp/snapshots/v0.0.0', 'This is only a test.\n')
+ .reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
+ }
)).export(module);
Please sign in to comment.
Something went wrong with that request. Please try again.