ticketman
Version:
A simple pull-based job/ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB
44 lines (33 loc) • 1.1 kB
JavaScript
// Generated by CoffeeScript 1.12.5
/*
* test for mock_tickets
*/
(function() {
var TicketManager, async, config, request, should, ticketManager;
should = require("should");
TicketManager = require("../").TicketManager;
config = require("../config/config")['development'];
request = require("request");
async = require("async");
ticketManager = new TicketManager("test ticket_manager", "http://localhost:3456");
describe("test mock_tickets", function() {
this.timeout(30 * 1000);
return it("should moch 100 tickets", function(done) {
var arr, category, content, i, iterator, j, title;
content = {
detailed: "content of ticket",
mixed: ["data"]
};
title = "test ticket " + (Date.now().toString(36));
category = "test";
arr = [];
for (i = j = 0; j <= 100; i = ++j) {
arr.push(i);
}
iterator = function(item, callback) {
return ticketManager.issue(title + "-" + item, category, content, callback);
};
return async.each(arr, iterator, done);
});
});
}).call(this);