Commit 001cd5d0 by David Baumgold

First few unit tests

parent 40098f65
......@@ -242,6 +242,7 @@ PIPELINE_JS = {
) + ['js/hesitate.js', 'js/base.js', 'js/views/feedback.js',
'js/models/section.js', 'js/views/section.js',
'js/models/metadata_model.js', 'js/views/metadata_editor_view.js',
'js/models/textbook.js', 'js/views/textbooks.js',
'js/views/assets.js'],
'output_filename': 'js/cms-application.js',
'test_order': 0
......
......@@ -9,6 +9,7 @@
"js/vendor/underscore-min.js",
"js/vendor/underscore.string.min.js",
"js/vendor/backbone-min.js",
"js/vendor/backbone-associations-min.js",
"js/vendor/jquery.leanModal.min.js",
"js/vendor/sinon-1.7.1.js",
"js/test/i18n.js"
......
describe "CMS.Models.Textbook", ->
beforeEach ->
@model = new CMS.Models.Textbook()
it "should have an empty name by default", ->
expect(@model.get("name")).toEqual("")
it "should not show chapters by default", ->
expect(@model.get("showChapters")).toBeFalsy()
it "should have a ChapterSet with one chapter by default", ->
expect(@model.get("chapters").length).toEqual(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment