Created
March 11, 2015 00:53
-
-
Save PandaWhisperer/53603004a094bba574f4 to your computer and use it in GitHub Desktop.
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
assert = require "assert" | |
{describe} = require "amen" | |
{promise} = require "when" | |
request = require "supertest" | |
app = require "../src/kick" | |
attempt = (fn) -> | |
promise (resolve, reject) -> | |
done = (err, result) -> | |
reject err if err? | |
resolve result | |
fn done | |
describe "Kick Server", (context) -> | |
context.test "Add DNS record", -> | |
yield attempt (done) -> | |
request(app) | |
.post "/" | |
.send | |
hostname: "test.sparkles.cluster" | |
ip_address: "10.1.2.3" | |
port: 1234 | |
type: "A" | |
.expect 201 | |
.expect /Done/ | |
.end done | |
context.test "Update DNS record", -> | |
yield attempt (done) -> | |
request(app) | |
.post "/" | |
.send | |
hostname: "test.sparkles.cluster" | |
ip_address: "10.11.22.33" | |
port: 1234 | |
type: "A" | |
.expect 201 | |
.expect /Done/ | |
.end done | |
context.test "Remove DNS record", -> | |
yield attempt (done) -> | |
request(app) | |
.delete "/" | |
.send | |
hostname: "test.sparkles.cluster" | |
ip_address: "10.11.22.33" | |
port: 1234 | |
type: "A" | |
.expect 201 | |
.expect /Done/ | |
.end done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment