slack-node
Version:
slack for node verision, full support
47 lines (39 loc) • 1.23 kB
JavaScript
// Generated by CoffeeScript 1.6.3
var Slack, apiToken, domain, should, webhookToken;
should = require("should");
Slack = require("../index");
domain = "slack-node";
webhookToken = "ROHgstANbsFAUA5dHHI5JONu";
apiToken = "xoxp-2307918714-2307918716-2307910813-17cabf";
describe('slack webhook part', function() {
var slack;
slack = new Slack(webhookToken, domain);
it(',should send a correct response', function(done) {
slack.should.be.an.Object;
return done();
});
return it(',should send a correct response', function(done) {
return slack.webhook({
channel: "#general",
username: "webhookbot",
text: "This is posted to #general and comes from a bot named webhookbot."
}, function(err, response) {
response.should.be.ok.and.an.Object;
return done();
});
});
});
describe("slack api part", function() {
var slack;
slack = new Slack(apiToken);
it(',shoule be return a slack object', function(done) {
slack.should.be.an.Object;
return done();
});
return it(", run with user.list", function(done) {
return slack.api("users.list", function(err, response) {
response.should.be.ok.and.an.Object;
return done();
});
});
});