Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Commit

Permalink
complete vs. completed in _promiseEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
davideast committed Jan 13, 2015
1 parent 84c2f83 commit a1b482e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/backbonefire.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
var success = params.success;
var error = params.error;
var context = params.context || this;
var completed = params.completed;
var complete = params.complete;

// set up an interval that checks to see if data has been synced from the server
var promiseInterval = setInterval(_.bind(function() {
Expand All @@ -228,8 +228,8 @@
}

// fire off the provided completed event
if(completed) {
completed.call(context);
if(complete) {
complete.call(context);
}

// the "promise" has been resolved, clear the interval
Expand Down
10 changes: 5 additions & 5 deletions test/specs/prototype_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ describe('Backbone.Firebase', function() {
expect(errorCalled).to.be.ok;
});

it('should resolve with a completed', function() {
var completedCalled = false;
it('should resolve with a complete', function() {
var completeCalled = false;
syncPromise.success = true;
Backbone.Firebase._promiseEvent({
syncPromise: syncPromise,
success: function() {

},
completed: function() {
completedCalled = true;
complete: function() {
completeCalled = true;
},
context: this
});
clock.tick(100);
expect(completedCalled).to.be.ok;
expect(completeCalled).to.be.ok;
});

});
Expand Down

0 comments on commit a1b482e

Please sign in to comment.