Return the new message for sendMessage and pin RPCs. Pass it through the sendMessage Promise callback.

This commit is contained in:
Ian Gulliver
2014-06-12 23:12:00 -07:00
parent 493f7b1456
commit 40229ff0c0
4 changed files with 24 additions and 11 deletions

View File

@@ -193,14 +193,16 @@ asyncTest('Complex object', function() {
});
asyncTest('sendMessage Promise', function() {
expect(1);
expect(3);
var subject = randstring();
var message = randstring();
var cosmo = new Cosmopolite({}, null, randstring());
cosmo.sendMessage(subject, message).then(function() {
cosmo.sendMessage(subject, message).then(function(msg) {
ok(true, 'sendMessage Promise fulfilled');
equal(msg['subject']['name'], subject);
equal(msg['message'], message);
cosmo.shutdown();
start();
});