Permalink
Browse files

Add failing test for #69

  • Loading branch information...
maritz committed Aug 21, 2012
1 parent a4ee319 commit d67e9231e60f09b158b49769f0a98c27f6e023d7
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/featureTests.js
View
@@ -984,6 +984,7 @@ exports["changing unique frees old unique with uppercase values"] = function (t)
var obj3 = nohm.factory('UserMockup');
var old = "Changing Unique Property Frees The Value";
obj.p('name', old);
+ obj.p('email', 'change_frees@unique.de');
obj.save(function (err) {
t.ok(!err, 'Unexpected saving error');
@@ -1002,3 +1003,24 @@ exports["changing unique frees old unique with uppercase values"] = function (t)
});
});
};
+
+exports["removing unique frees unique with uppercase values"] = function (t) {
+ t.expect(3);
+ var obj = nohm.factory('UserMockup');
+ var obj2 = nohm.factory('UserMockup');
+ var old = "Removing Unique Property Frees The Value";
+ obj.p('name', old);
+ obj.p('email', 'remove_frees@unique.de');
+
+ obj.save(function (err) {
+ t.ok(!err, 'Unexpected saving error: '+err);
+ obj.remove(obj.id, function (err) {
+ t.ok(!err, 'Unexpected removing error: '+err);
+ obj2.p('name', old);
+ obj2.save(function (err) {
+ t.ok(!err, 'Unexpected saving error. (May be because old uniques are not freed properly on chnage.');
+ t.done();
+ });
+ });
+ });
+};

0 comments on commit d67e923

Please sign in to comment.