Permalink
Browse files

[test] Add test for "snapshots activate" without an app argument

  • Loading branch information...
1 parent ab962e1 commit 5c4dff385fc33a8c8f9ab39621a033630a41c4a6 @jfhbrook jfhbrook committed Feb 28, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/commands/snapshots-test.js
@@ -154,4 +154,25 @@ vows.describe('jitsu/commands/snapshots').addBatch({
process.chdir(mainDirectory);
assert.ok(!err);
})
+}).addBatch({
+ 'snapshots activate': shouldNodejitsuOk(function setup() {
+ jitsu.prompt.override.snapshot = '0.0.0-1';
+
+ 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' })
+ .post('/apps/tester/example-app/snapshots/0.0.0-1/activate', {})
+ .reply(200, '', { 'x-powered-by': 'Nodejitsu' });
+ }, function assertion (err) {
+ process.chdir(mainDirectory);
+ assert.ok(!err);
+ })
}).export(module);

0 comments on commit 5c4dff3

Please sign in to comment.