diff options
Diffstat (limited to 'js/tests/unit/service/ModelSpec.js')
-rw-r--r-- | js/tests/unit/service/ModelSpec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/tests/unit/service/ModelSpec.js b/js/tests/unit/service/ModelSpec.js index d8aba1520..57b0f422c 100644 --- a/js/tests/unit/service/ModelSpec.js +++ b/js/tests/unit/service/ModelSpec.js @@ -100,4 +100,30 @@ describe('Model', function () { expect(childModel.size()).toBe(1); }); + + it('should clear all models', function () { + var object1, + object2; + + object1 = { + id: 3, + name: 'test', + test: 'ho' + }; + + object2 = { + id: 4, + name: 'test2' + }; + + childModel.add(object1); + childModel.add(object2); + + childModel.clear(); + + expect(childModel.get(3)).not.toBeDefined(); + expect(childModel.get(4)).not.toBeDefined(); + expect(childModel.size()).toBe(0); + }); + });
\ No newline at end of file |