Commit acb775c8

mo <mo.khan@gmail.com>
2017-09-24 21:49:07
add spec for auto collection.
1 parent fb082e6
Changed files (1)
spec
spec/javascripts/models/auto_collection_spec.js.coffee
@@ -0,0 +1,13 @@
+describe "AutoCollection", ->
+  subject = null
+  beforeEach ->
+    subject = csx.AutoCollection
+
+  describe ".install", ->
+    it "installs a categories collection", ->
+      subject.install('Categories', [id: 1, name: 'cakes'])
+
+      expect(csx.Categories).not.toBe(undefined)
+      expect(csx.Categories.length).toEqual(1)
+      expect(csx.Categories.first().get('name')).toEqual('cakes')
+