diff options
Diffstat (limited to 'spec/javascripts/models/auto_collection_spec.js.coffee')
| -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) |
