backbone.rel
Advanced tools
Comparing version
@@ -98,3 +98,3 @@ /** | ||
if (eventBus && !result) { | ||
if (eventBus && _.isNumber(id) && !result) { | ||
eventBus.trigger && eventBus.trigger('backbone-rel:missing', this.key, id); | ||
@@ -101,0 +101,0 @@ } |
{ | ||
"name": "backbone.rel", | ||
"description": "Lightweight relationship assistant for your backbone applications", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"author": "Pau ramon <masylum@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": ["Maxim Colls <collsmaxim@gmail.com>", "Saimon Moore <saimonmoore@gmail.com>"], |
@@ -130,2 +130,22 @@ /*global it, describe, afterEach, before, beforeEach*/ | ||
}); | ||
describe('if association_id is not present', function () { | ||
var user, missing_project; | ||
beforeEach(function () { | ||
user = users.get(0); | ||
user.set({project_id: null}, {silent: true}); | ||
}); | ||
afterEach(function () { | ||
user = users.get(0); | ||
user.set({project_id: 0}, {silent: true}); | ||
}); | ||
it('does not trigger a "backbone-rel:missing" event on the event bus', function () { | ||
user.rel('project'); | ||
assert.equal(events_triggered.length, 0); | ||
}); | ||
}); | ||
}); | ||
@@ -132,0 +152,0 @@ }); |
28600
2.18%632
2.43%