Fix test
This commit is contained in:
parent
2244dda566
commit
470b0a2c4f
@ -26,7 +26,7 @@ describe("Link plugin", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.irc.createMessage({
|
this.irc.createMessage({
|
||||||
message: "http://localhost:9002/basic"
|
msg: "http://localhost:9002/basic"
|
||||||
});
|
});
|
||||||
|
|
||||||
this.irc.once("toggle", function(data) {
|
this.irc.once("toggle", function(data) {
|
||||||
|
12
test/util.js
12
test/util.js
@ -4,7 +4,7 @@ var _ = require("lodash");
|
|||||||
var express = require("express");
|
var express = require("express");
|
||||||
|
|
||||||
function MockClient(opts) {
|
function MockClient(opts) {
|
||||||
this.me = "test-user";
|
this.user = {nick: "test-user"};
|
||||||
|
|
||||||
for (var k in opts) {
|
for (var k in opts) {
|
||||||
this[k] = opts[k];
|
this[k] = opts[k];
|
||||||
@ -15,12 +15,12 @@ util.inherits(MockClient, EventEmitter);
|
|||||||
MockClient.prototype.createMessage = function(opts) {
|
MockClient.prototype.createMessage = function(opts) {
|
||||||
|
|
||||||
var message = _.extend({
|
var message = _.extend({
|
||||||
message: "dummy message",
|
msg: "dummy message",
|
||||||
from: "test-user",
|
nick: "test-user",
|
||||||
to: "test-channel"
|
target: "#test-channel"
|
||||||
}, opts);
|
}, opts);
|
||||||
|
|
||||||
this.emit("message", message);
|
this.emit("privmsg", message);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -30,7 +30,7 @@ module.exports = {
|
|||||||
createNetwork: function() {
|
createNetwork: function() {
|
||||||
return {
|
return {
|
||||||
channels: [{
|
channels: [{
|
||||||
name: "test-channel",
|
name: "#test-channel",
|
||||||
messages: []
|
messages: []
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user