Created
July 20, 2012 12:57
-
-
Save mdb/3150598 to your computer and use it in GitHub Desktop.
tests/author.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(resp.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