Browse files

[test] "snapshots destroy" with no app name

  • Loading branch information...
1 parent 8cfc868 commit a1791beb17e9285478a0f88d09cce7ec95a41b10 @jfhbrook jfhbrook committed Feb 27, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/commands/snapshots-test.js
View
23 test/commands/snapshots-test.js
@@ -175,4 +175,27 @@ vows.describe('jitsu/commands/snapshots').addBatch({
process.chdir(mainDirectory);
assert.ok(!err);
})
+}).addBatch({
+ 'snapshots destroy': shouldNodejitsuOk(function setup() {
+ jitsu.prompt.override.answer = 'yes';
+ jitsu.prompt.override.snapshot = '0.0.0-1';
+ jitsu.prompt.override.destroy = 'yes';
+
+ useAppFixture();
+
+ nock('http://api.mockjitsu.com')
+ .get('/apps/tester/example-app/snapshots')
+ .reply(200, {
+ snapshots: [{
+ id: '0.0.0-1',
+ ctime: new Date(),
+ md5: 'q34rq43r5t5g4w56t45t'
+ }]
+ }, { 'x-powered-by': 'Nodejitsu' })
+ .delete('/apps/tester/example-app/snapshots/0.0.0-1', {})
+ .reply(200, '', { 'x-powered-by': 'Nodejitsu' });
+ }, function assertion (err) {
+ process.chdir(mainDirectory);
+ assert.ok(!err);
+ })
}).export(module);

0 comments on commit a1791be

Please sign in to comment.