describe('<%= object_name %>View', function() { var view, model; describe('new record', function() { beforeEach(function() { model = new <%= object_name %>(); }); it('should render with a create button', function() { view = new <%= object_name %>View({model: model}); view.render(); expect(view.$('button.save')).toHaveText('Create'); }); }); describe('existing record', function() { beforeEach(function() { model = new <%= object_name %>({id: 1}); }); it('should render with an update button', function() { view = new <%= object_name %>View({model: model}); view.render(); expect(view.$('button.save')).toHaveText('Update'); }); }); });