Update test to ensure unique listener callback behavior

This commit is contained in:
Scott Kyle 2015-11-03 14:45:06 -08:00
parent 83869e2193
commit 2f4bcee5ce
1 changed files with 5 additions and 2 deletions

View File

@ -289,8 +289,11 @@ module.exports = BaseTest.extend({
var secondNotificationCount = 0;
function secondNotification(realm, name) {
secondNotificationCount++;
};
realm.addListener('change', secondNotification)
}
// The listener should only be added once.
realm.addListener('change', secondNotification);
realm.addListener('change', secondNotification);
realm.write(function() {});
TestCase.assertEqual(notificationCount, 2);