diff options
| author | mo <mo.khan@gmail.com> | 2017-09-24 16:10:29 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-09-24 16:10:29 -0600 |
| commit | 79f42163ba1d6c5b699f9f8281aaab8a2a059847 (patch) | |
| tree | 47542d1b1c241ff61912853946fa3d833c4495cd /spec/javascripts | |
| parent | acb775c8b05c3aaae39040b87302f25ab81d196c (diff) | |
move collections to Collections namespace.
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/models/auto_collection_spec.js.coffee | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/spec/javascripts/models/auto_collection_spec.js.coffee b/spec/javascripts/models/auto_collection_spec.js.coffee index 6dfd9149..18241774 100644 --- a/spec/javascripts/models/auto_collection_spec.js.coffee +++ b/spec/javascripts/models/auto_collection_spec.js.coffee @@ -5,9 +5,23 @@ describe "AutoCollection", -> describe ".install", -> it "installs a categories collection", -> - subject.install('Categories', [id: 1, name: 'cakes']) + subject.install('Category', [id: 1, name: 'cakes']) - expect(csx.Categories).not.toBe(undefined) - expect(csx.Categories.length).toEqual(1) - expect(csx.Categories.first().get('name')).toEqual('cakes') + collection = csx.Collections.Category + expect(collection).not.toBe(undefined) + expect(collection.length).toEqual(1) + expect(collection.first().get('name')).toEqual('cakes') + + it "binds the proper model", -> + subject.install('Category', []) + expect(csx.Collections.Category.model).toEqual(csx.Models.Category) + + it "binds the proper url", -> + subject.install('Cake', []) + expect(csx.Collections.Cake.url).toEqual('/api/v1/cakes') + + +#class csx.Collections.CakesCollection extends Backbone.Collection + #model: csx.Models.Cake + #url: '/api/v1/cakes' |
