ValidNotification behaviour will change. Test now.

This commit is contained in:
Andrew Naylor 2015-02-28 17:20:53 +00:00
Родитель 5ceea668bb
Коммит 0a123083cb
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -418,4 +418,30 @@ describe("Connection", function() {
});
});
});
describe("validNotification", function() {
describe("notification is shorter than max allowed", function() {
it("returns true", function() {
var connection = Connection();
var notification = { length: function() { return 128; }};
expect(connection.validNotification(notification)).to.equal(true);
});
});
describe("notification is the maximum length", function() {
it("returns true", function() {
var connection = Connection();
var notification = { length: function() { return 2048; }};
expect(connection.validNotification(notification)).to.equal(true);
});
});
describe("notification too long", function() {
it("returns false", function() {
var connection = Connection();
var notification = { length: function() { return 2176; }};
expect(connection.validNotification(notification)).to.equal(false);
});
});
});
});