Permalink
Browse files

fix issue #59

  • Loading branch information...
1 parent 6c44634 commit d04a031b4a779cb72771eb6cdf109446771c488f Niall Smart committed Sep 23, 2011
Showing with 15 additions and 1 deletion.
  1. +1 −1 src/adapters/dom.js
  2. +14 −0 test/lawnchair-spec.js
View
@@ -68,8 +68,8 @@ Lawnchair.adapter('dom', (function() {
// now we kil the key and use it in the store colleciton
delete obj.key;
storage.setItem(key, JSON.stringify(obj))
+ obj.key = key.slice(this.name.length + 1)
if (callback) {
- obj.key = key.replace(this.name + '.', '')
this.lambda(callback).call(this, obj)
}
return this
@@ -203,6 +203,20 @@ test( 'saving objects', function() {
})
})
+test( 'save without callback', function() {
+
+ QUnit.stop();
+ QUnit.expect(1);
+
+ store.save(me, function(obj) {
+ var key = obj.key;
+ store.save(obj);
+ equals(obj.key, key, "save without callback retains key");
+ QUnit.start();
+ })
+
+});
+
module('batch()', {
setup:function() {
QUnit.stop();

0 comments on commit d04a031

Please sign in to comment.