hubot-deploy
Version:
hubot script for GitHub Flow
39 lines (32 loc) • 1.64 kB
text/coffeescript
Path = require "path"
Version = require(Path.join(__dirname, "..", "..", "..", "src", "version")).Version
Deployment = require(Path.join(__dirname, "..", "..", "..", "src", "github", "api")).Deployment
describe "Deployment fixtures", () ->
describe "#autoMerge", () ->
it "works with auto-merging", () ->
deployment = new Deployment("hubot", "master", "deploy", "production", "", "")
assert.equal(false, deployment.autoMerge)
describe "#api", () ->
context "with no ca file", () ->
it "doesnt set agentOptions", () ->
deployment = new Deployment("hubot", "master", "deploy", "production", "", "")
api = deployment.api()
assert.equal(api.requestDefaults.agentOptions, null)
context "with ca file", () ->
it "sets agentOptions.ca", () ->
process.env.HUBOT_CA_FILE = Path.join(__dirname, "..", "..", "fixtures", "cafile.txt")
deployment = new Deployment("hubot", "master", "deploy", "production", "", "")
api = deployment.api()
assert(api.requestDefaults.agentOptions.ca)
# failureMessage = "Unable to create deployments for github/github. Check your scopes for this token."