integration test for notifications

This commit is contained in:
brianc 2010-10-23 23:12:02 -05:00
parent 09d8e5d1e7
commit 1b56e708e9

View File

@ -0,0 +1,15 @@
var helper = require(__dirname + '/test-helper');
//http://www.postgresql.org/docs/8.3/static/libpq-notify.html
test('recieves notification from same connection with no payload', function() {
helper.connect(function(con) {
con.query('LISTEN boom');
assert.raises(con, 'readyForQuery', function() {
con.query("NOTIFY boom");
assert.raises(con, 'notificationResponse', function(msg) {
assert.equal(msg.payload, "");
assert.equal(msg.channel, 'boom')
con.end();
});
});
});
});