
// http://mochajs.org/
// @see http://chaijs.com/api/bdd/
describe('View', function() {
  var App;
  var View;
  var testView;

  beforeEach(function() {
    App = window.App;
    View = App.View;
  });

  afterEach(function() {
    testView = undefined;

    App = null;
    View = null;
  });

  it('should set template', function() {
    testView = new View('<div><%= name %></div>');

    expect(typeof testView.template).to.equal('function');
  });

  it('should render simple template', function() {
    testView = new View('<div><%= name %></div>');

    var testData = { name: 'test' };
    var result = testView.render(testData);
    var reference = '<div>test</div>';

    expect(result).to.equal(reference);
  });

});

@@ -441,32 +441,33 @@
 ction');%0A  %7D);%0A%0A
+%0A
   it('should ren
@@ -721,12 +721,410 @@
 %0A  %7D);%0A%0A
+%0A  it('should set tempalte (with JS code) ', function () %7B%0A%0A    testView = new View ('%3Cdiv%3E%3C%25 dataItems.forEach(function(item) %7B %25%3E %3C%25= item %25%3E %3C%25  %7D); %25%3E %3Cdiv%3E');%0A%0A    var testData = %7BdataItems: %5B%7B item: 'testItem0'%7D, %7B item: 'testItem1'%7D%5D%7D;%0A    var result = testView.render(testData);%0A    var reference = '%3Cdiv%3EtestItem0%3Cdiv%3E%3Cdiv%3EtestItem1%3Cdiv%3E';%0A%0A    expect(result).to.equal(reference);%0A%0A  %7D);%0A%0A
 %7D);%0A

Add render template with js instructions