Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[test] snapshots tests with tester/app arguments

  • Loading branch information...
commit fefbbc0f2d0672dd1470decfbf02e978e648b7d1 1 parent 85c803f
Joshua Holbrook jfhbrook authored
Showing with 58 additions and 0 deletions.
  1. +58 −0 test/commands/snapshots-test.js
58 test/commands/snapshots-test.js
View
@@ -78,6 +78,64 @@ vows.describe('jitsu/commands/snapshots').addBatch({
.reply(200, '', { 'x-powered-by': 'Nodejitsu' });
})
}).addBatch({
+ 'snapshots list tester/application': shouldNodejitsuOk(function setup() {
+ nock('http://api.mockjitsu.com')
+ .get('/apps/tester/application/snapshots')
+ .reply(200, {
+ snapshots: [{
+ id: '0.0.0',
+ ctime: new Date(),
+ md5: 'q34rq43r5t5g4w56t45t'
+ }]
+ }, { 'x-powered-by': 'Nodejitsu' });
+ })
+}).addBatch({
+ 'snapshots list tester/application2': shouldNodejitsuOk(function setup() {
+ nock('http://api.mockjitsu.com')
+ .get('/apps/tester/application2/snapshots')
+ .reply(200, {
+ snapshots: [{
+ id: '0.0.0',
+ ctime: new Date(),
+ md5: 'q34rq43r5t5g4w56t45t'
+ }]
+ }, { 'x-powered-by': 'Nodejitsu' });
+ })
+}).addBatch({
+ 'snapshots activate tester/application2': shouldNodejitsuOk(function setup() {
+ jitsu.prompt.override.snapshot = '0.0.0-1';
+
+ nock('http://api.mockjitsu.com')
+ .get('/apps/tester/application2/snapshots')
+ .reply(200, {
+ snapshots: [{
+ id: '0.0.0-1',
+ ctime: new Date(),
+ md5: 'q34rq43r5t5g4w56t45t'
+ }]
+ }, { 'x-powered-by': 'Nodejitsu' })
+ .post('/apps/tester/application2/snapshots/0.0.0-1/activate', {})
+ .reply(200, '', { 'x-powered-by': 'Nodejitsu' });
+ })
+}).addBatch({
+ 'snapshots destroy tester/application3': shouldNodejitsuOk(function setup() {
+ jitsu.prompt.override.answer = 'yes';
+ jitsu.prompt.override.snapshot = '0.0.0-1';
+ jitsu.prompt.override.destroy = 'yes';
+
+ nock('http://api.mockjitsu.com')
+ .get('/apps/tester/application3/snapshots')
+ .reply(200, {
+ snapshots: [{
+ id: '0.0.0-1',
+ ctime: new Date(),
+ md5: 'q34rq43r5t5g4w56t45t'
+ }]
+ }, { 'x-powered-by': 'Nodejitsu' })
+ .delete('/apps/tester/application3/snapshots/0.0.0-1', {})
+ .reply(200, '', { 'x-powered-by': 'Nodejitsu' });
+ })
+}).addBatch({
// This tests jitsu's ability to infer the app name.
'snapshots list': shouldNodejitsuOk(function setup() {
Please sign in to comment.
Something went wrong with that request. Please try again.