Running the same text case as another member
// File:
/can/view/ejs/ejs_test.js
// Failing test case
test('helpers', function () {
can.EJS.Helpers.prototype.simpleHelper = function () {
return 'Simple';
};
can.EJS.Helpers.prototype.elementHelper = function () {
return function (el) {
el.innerHTML = 'Simple';
};
};
var text = '<div><%= simpleHelper() %></div>';
var compiled = new can.EJS({
text: text
}).render();
equal(compiled, '<div>Simple</div>');
text = '<div id="hookup" <%= elementHelper() %>></div>';
compiled = new can.EJS({
text: text
}).render();
can.append(can.$('#qunit-fixture'), can.view.frag(compiled));
equal(can.$('#hookup')[0].innerHTML, 'Simple');
});
Output Of Above Code
<div id="hookup" data-view-id='145'></div>
What Im Expecting
<div id="hookup" data-view-id='145'>Simple</div>