describe('<%= plural_object_name %>View', function() { var view, collection; beforeEach(function() { collection = new <%= plural_object_name %>(); }); it('should render', function() { view = new <%= plural_object_name %>View({collection: collection}); view.render(); expect($(view.el)).toContain('.list'); expect($(view.el)).toContain('button.new'); }); it('should add a new model when new is clicked', function() { view.$('button.new').trigger('click'); expect(view.$('.list')).toContain('.<%= underscore_name %>'); expect(collection.length).toEqual(1); }); });