Permalink
Browse files

added functionality to updates

  • Loading branch information...
chrisdew committed Nov 22, 2012
1 parent b574cfc commit 4f604782902e408c19646b62e31a0c19f2dc86cb
Showing with 9 additions and 1 deletion.
  1. +9 −1 test/table-test.js
View
@@ -43,13 +43,21 @@ describe('Table', function() {
bar.nextPk);
});
- it('sjould update a record', function(done) {
+ it('should update a record', function(done) {
bar.once('delta', function(delta) {
assert.deepEqual({"op":"update","table":"bar","pk":"1","set":[{"field":"foo","expr":"hello"}]}, delta);
done();
});
bar.update({"table":"bar","set":[{"field":"foo","expr":"hello"}],"where":{"expr":{"fn":"equal","args":[{field:"id"},1]}}});
});
+ it('should update a record again', function(done) {
+ bar.once('delta', function(delta) {
+ assert.deepEqual({"op":"update","table":"bar","pk":"1","set":[{"field":"foo","expr":"hello"}]}, delta);
+ done();
+ });
+ bar.update({"table":"bar","set":[{"field":"foo","expr":"world"}],"where":{"expr":{"fn":"equal","args":[{field:"id"},1]}}});
+ });
+
});

0 comments on commit 4f60478

Please sign in to comment.