diff options
| author | mo <mo.khan@gmail.com> | 2017-09-24 16:41:58 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-09-24 16:41:58 -0600 |
| commit | 576a045848457252df3b96e1bd66532d5c86b382 (patch) | |
| tree | 6a1f669d9e843ff5eb37a5370b2db0d6979f7e9c /spec/javascripts | |
| parent | 79f42163ba1d6c5b699f9f8281aaab8a2a059847 (diff) | |
bind auto collections to a url.
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/models/auto_collection_spec.js.coffee | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/javascripts/models/auto_collection_spec.js.coffee b/spec/javascripts/models/auto_collection_spec.js.coffee index 18241774..30f073ce 100644 --- a/spec/javascripts/models/auto_collection_spec.js.coffee +++ b/spec/javascripts/models/auto_collection_spec.js.coffee @@ -5,7 +5,7 @@ describe "AutoCollection", -> describe ".install", -> it "installs a categories collection", -> - subject.install('Category', [id: 1, name: 'cakes']) + subject.install('Category', 'categories', [id: 1, name: 'cakes']) collection = csx.Collections.Category expect(collection).not.toBe(undefined) @@ -13,15 +13,14 @@ describe "AutoCollection", -> expect(collection.first().get('name')).toEqual('cakes') it "binds the proper model", -> - subject.install('Category', []) + subject.install('Category', 'categories', []) expect(csx.Collections.Category.model).toEqual(csx.Models.Category) it "binds the proper url", -> - subject.install('Cake', []) + subject.install('Cake', 'cakes', []) expect(csx.Collections.Cake.url).toEqual('/api/v1/cakes') - -#class csx.Collections.CakesCollection extends Backbone.Collection - #model: csx.Models.Cake - #url: '/api/v1/cakes' - + it "works for models that do not map to a backbone model", -> + subject.install('Tag', 'acts_as_taggable_on_tags', []) + expect(csx.Collections.Tag.model).toEqual(Backbone.Model) + expect(csx.Collections.Tag.url).toEqual(undefined) |
