Merge pull request #198 from thelounge/astorije/test-network-export
Add a very basic test for Network#export
This commit is contained in:
commit
0b3696a39b
30
test/models/network.js
Normal file
30
test/models/network.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var expect = require("chai").expect;
|
||||||
|
|
||||||
|
var Chan = require("../../src/models/chan");
|
||||||
|
var Network = require("../../src/models/network");
|
||||||
|
|
||||||
|
describe("Network", function() {
|
||||||
|
describe("#export()", function() {
|
||||||
|
|
||||||
|
it("should produce an valid object", function() {
|
||||||
|
var network = new Network({name: "networkName"});
|
||||||
|
network.channels.push(new Chan({name: "#thelounge"}));
|
||||||
|
network.channels.push(new Chan({name: "&foobar"}));
|
||||||
|
|
||||||
|
expect(network.export()).to.deep.equal({
|
||||||
|
name: "networkName",
|
||||||
|
host: "",
|
||||||
|
port: 6667,
|
||||||
|
tls: false,
|
||||||
|
password: "",
|
||||||
|
username: "",
|
||||||
|
realname: "",
|
||||||
|
commands: [],
|
||||||
|
nick: undefined,
|
||||||
|
join: "#thelounge,&foobar",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user