diff --git a/spec/bin/backbone-generator_spec.rb b/spec/bin/backbone-generator_spec.rb index c3130e3..a91f9fb 100644 --- a/spec/bin/backbone-generator_spec.rb +++ b/spec/bin/backbone-generator_spec.rb @@ -46,6 +46,7 @@ describe 'backbone-generator' do File.file?(template = 'app/views/section/models.jst').should be_true File.read(view).should match(/SectionModelsView/) + File.read(view).should match(/SectionModelView/) File.read(view).should match(%r{template: JST\['section/models'\]}) File.read(spec).should match(/SectionModelsView/) end diff --git a/templates/collection_view.js.erb b/templates/collection_view.js.erb index 1a78172..742ce8f 100644 --- a/templates/collection_view.js.erb +++ b/templates/collection_view.js.erb @@ -13,7 +13,7 @@ var <%= object_name %>sView = Backbone.View.extend({ $(this.el).html(this.template()); }, addOne: function(model) { - var view = new <%= object_name %>({model: model}); + var view = new <%= object_name %>View({model: model}); this.$('.list').append(view.render().el); }, addAll: function() {