Permalink
Browse files

Update model save test.

  • Loading branch information...
GCheung55 committed Jul 18, 2012
1 parent fe78e03 commit 6c51ba6bbab7d32fa70879540e554088f6d6c460
Showing with 2 additions and 19 deletions.
  1. +2 −19 test/model-sync-test.js
View
@@ -254,14 +254,14 @@ buster.testCase('Neuro Sync Model', {
// Set the link option to chain
model.request.setOptions({link: 'chain'});
- model.save(void 0, void 0, function(response){
+ model.save(function(response){
spy(response.count);
assert.calledWith(spy, 1);
this.request.addEvent('request', function(){
server.respond([response.code, response.contentType, JSON.stringify({count:2})]);
});
- }).save(void 0, void 0, function(response){
+ }).save(function(response){
spy(response.count);
assert.calledWith(spy, 2);
done();
@@ -295,23 +295,6 @@ buster.testCase('Neuro Sync Model', {
assert.calledWith(spy, 'update');
},
- 'save should set prop/values before sending a request if prop/values are passed to the method': function(){
- var spy = this.spy(),
- model = this.mockSyncModel,
- response = this.mockResponse,
- server = this.server;
-
- model.addEvent('save', function(response){spy();});
-
- model.save({firstName: 'Patrick'});
-
- assert.equals(model.get('firstName'), 'Patrick');
-
- server.respond([response.code, response.contentType, '{}']);
-
- assert.called(spy);
- },
-
'save should send the model\'s data': function(){
var spy = this.spy(),
createResponse = this.mockResponse,

0 comments on commit 6c51ba6

Please sign in to comment.