summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2017-09-24 15:49:07 -0600
committermo <mo.khan@gmail.com>2017-09-24 15:49:07 -0600
commitacb775c8b05c3aaae39040b87302f25ab81d196c (patch)
tree1bc216fc0fb26808331ab82fb2fee7098716da10
parentfb082e6bf91c5ee0c058c83816f8407b3cee0e7e (diff)
add spec for auto collection.
-rw-r--r--spec/javascripts/models/auto_collection_spec.js.coffee13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/javascripts/models/auto_collection_spec.js.coffee b/spec/javascripts/models/auto_collection_spec.js.coffee
new file mode 100644
index 00000000..6dfd9149
--- /dev/null
+++ b/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')
+