define(['base/view', 'sinon', 'component/eventBus', 'jquery'], function(View, sinon, events, $) {

    describe('View', function() {

        describe('destroy', function() {

            it('unbinds all events bound by the view', function() {
                var spy = sinon.spy();

                var view = new View();
                view.bindTo(events, "test", spy);
                view.destroy();

                events.trigger("test");

                expect(spy).not.toHaveBeenCalled();
            });

            it('unbinds the events bound directly on the view', function() {
                var spy = sinon.spy();

                var view = new View();
                view.on("test", spy);
                view.destroy();

                view.trigger("test");

                expect(spy).not.toHaveBeenCalled();
            });

            it('unbinds events bound on subviews', function() {
                var spy = sinon.spy();

                var TestView = View.extend({
                    initialize: function() {
                        this.bindTo(events, "test", spy);
                    }
                });

                var view = new View();
                var testView = new TestView();

                view.addSubView(testView);
                view.destroy();

                events.trigger("test");

                expect(spy).not.toHaveBeenCalled();
            });

            it('unbinds delegated events', function() {
                var spy = sinon.spy();

                var TestView = View.extend({
                    events: {
                        'click': spy
                    }
                });

                var testView = new TestView();
                testView.destroy();

                testView.$el.click();

                expect(spy).not.toHaveBeenCalled();
            });

            it('removes the view from the DOM', function() {
                var DOM = $('<div></div>');

                var TestView = View.extend({
                    className: 'someClass',
                    tagName: 'h1'
                });

                var testView = new TestView();

                DOM.append(testView.el);

                expect(DOM.html()).toEqual('<h1 class="someClass"></h1>');

                testView.destroy();

                expect(DOM.html()).toEqual('');
            });

        });

    });

});

@@ -119,32 +119,1300 @@
 , function() %7B%0A%0A
+        describe('render template', function() %7B%0A%0A            var testView, template;%0A%0A            beforeEach(function() %7B%0A                template = sinon.mock();%0A%0A                var TestView = View.extend(%7B%0A                    template: template%0A                %7D);%0A%0A                testView = new TestView();%0A            %7D);%0A%0A            it('accepts a template specified as a function', function() %7B%0A                template.returns('%3Ch1%3ETestView%3C/h1%3E');%0A%0A                testView.renderTemplate();%0A%0A                expect(testView.$('h1').text()).toEqual('TestView');%0A            %7D);%0A%0A            it('passes input to the template function', function() %7B%0A                var data = %7B key: %22value%22 %7D;%0A%0A                testView.renderTemplate(data);%0A%0A                expect(testView.template).toHaveBeenCalledWith(data);%0A            %7D);%0A%0A            it('combines several input arguments', function() %7B%0A                testView.renderTemplate(%7B key: %22value%22 %7D, %7B key2: %22value2%22 %7D);%0A%0A                var call = testView.template.firstCall;%0A%0A                var args = call.args;%0A%0A                expect(args.length).toEqual(1);%0A                expect(args%5B0%5D.key).toEqual(%22value%22);%0A                expect(args%5B0%5D.key2).toEqual(%22value2%22);%0A            %7D);%0A%0A        %7D);%0A%0A
         describe

Add specs for renderTemplate