Permalink
Browse files

[test] Databases api tests

  • Loading branch information...
1 parent 20a7eb0 commit 2c2410885ccc3e2e80183b1cf1702b5e4ea35157 @jfhbrook jfhbrook committed Mar 15, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 node.js/test/commands/databases-test.js
@@ -0,0 +1,34 @@
+var vows = require('vows'),
+ assert = require('assert'),
+ nock = require('nock'),
+ makeApiCall = require('../macros').makeApiCall;
+
+vows.describe('databases').addBatch(makeApiCall(
+ 'databases create couch chair',
+ function setup () {
+ nock('http://api.mockjitsu.com')
+ .post('/databases/tester/chair', { type: 'couch'})
+ .reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
+ }
+)).addBatch(makeApiCall(
+ 'databases get chair',
+ function setup () {
+ nock('http://api.mockjitsu.com')
+ .get('/databases/tester/chair')
+ .reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
+ }
+)).addBatch(makeApiCall(
+ 'databases list',
+ function setup () {
+ nock('http://api.mockjitsu.com')
+ .get('/databases/tester')
+ .reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
+ }
+)).addBatch(makeApiCall(
+ 'databases destroy chair',
+ function setup () {
+ nock('http://api.mockjitsu.com')
+ .delete('/databases/tester/chair', {})
+ .reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
+ }
+)).export(module);

0 comments on commit 2c24108

Please sign in to comment.