Small improvement to notifications test

This commit is contained in:
Scott Kyle 2015-10-12 23:19:54 -07:00
parent 290234cb8a
commit 6a550f285f
1 changed files with 8 additions and 3 deletions

View File

@ -272,14 +272,19 @@ var RealmTests = {
},
testNotifications: function() {
var notificationCount = 0;
var realm = new Realm({schema: []});
var notification = realm.addNotification(function() {
var notificationCount = 0;
var notificationName;
var notification = realm.addNotification(function(realm, name) {
notificationCount++;
notificationName = name;
});
TestCase.assertEqual(notificationCount, 0);
realm.write(function() {});
TestCase.assertEqual(notificationCount, 1);
TestCase.assertEqual(notificationName, 'DidChangeNotification');
},
};