Added some Jasmine tests for section views in Backbone

This commit is contained in:
David Baumgold
2013-05-15 17:51:50 -04:00
parent 90a9c386eb
commit 2b01273f7f
4 changed files with 83 additions and 4 deletions

View File

@@ -19,13 +19,13 @@ CMS.Views.SectionShow = Backbone.View.extend({
});
CMS.Views.SectionEdit = Backbone.View.extend({
template: _.template($("#section-name-edit-tpl").text()),
render: function() {
this.$el.html(this.template(this.model.attributes));
this.delegateEvents();
return this;
},
initialize: function() {
this.template = _.template($("#section-name-edit-tpl").text());
this.listenTo(this.model, "invalid", this.showErrorMessage);
this.render();
},