Skip to content

Instantly share code, notes, and snippets.

@mdb
Created July 20, 2012 12:56
Show Gist options
  • Save mdb/3150594 to your computer and use it in GitHub Desktop.
Save mdb/3150594 to your computer and use it in GitHub Desktop.
tests/author.js
var assert = require("assert");
var request = require("request");
describe('auther', function () {
var auther = require("../auther");
it('exists', function () {
it('should not be null', function () {
assert.notEqual(auther, null);
});
it('should not be undefined', function () {
assert.notEqual(auther, undefined);
});
});
it('starts a server that listens on port 4824 by default', function () {
request('http://localhost:4824', function(err, resp, body) {
assert(response.statusCode === 200);
});
});
//when we send a put request to localhost/some_username with a request body contaning a password and an api key, author will return 200 ok
it('returns 200 when we send a PUT request to localhost/someUser', function () {
// start up auther server
// form the request
// send the request
// get the response
// response body should be 200
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment