Started writing Backbone tests

Hacking the Python, because our JS dependency management is borked.
This commit is contained in:
David Baumgold
2013-05-13 10:45:55 -04:00
parent 69a6ec0c97
commit e440580c79
3 changed files with 9 additions and 3 deletions

View File

@@ -221,7 +221,8 @@ PIPELINE_JS = {
'source_filenames': sorted(
rooted_glob(COMMON_ROOT / 'static/', 'coffee/src/**/*.js') +
rooted_glob(PROJECT_ROOT / 'static/', 'coffee/src/**/*.js')
) + ['js/hesitate.js', 'js/base.js'],
) + ['js/hesitate.js', 'js/base.js',
'js/models/feedback.js', 'js/views/feedback.js'],
'output_filename': 'js/cms-application.js',
'test_order': 0
},

View File

@@ -0,0 +1,5 @@
describe "CMS.Models.SystemFeedback", ->
m = new CMS.Models.SystemFeedback()
it "should have an empty message by default", ->
expect(m.get("message")).toEqual("")

View File

@@ -1,8 +1,8 @@
CMS.Models.SystemFeedback = Backbone.Model.extend({
defaults: {
"type": null, // "warning", "confirmation", "error", "announcement", "step-required", etc
"title": null,
"message": null,
"title": "",
"message": "",
"shown": true,
"close": false, // show a close button?
"icon": true, // show an icon?