Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanflorence/9318497 to your computer and use it in GitHub Desktop.
Save ryanflorence/9318497 to your computer and use it in GitHub Desktop.
Function.prototype.compile = function() {
var template = this.toString().split('\n').slice(1,-1).join('\n') + '\n';
return Ember.Handlebars.compile(template);
}
/*******************************************************/
test('sets first tab found to active', function() {
expect(2);
var component = this.subject({
template: function(){/*
{{#ic-tab-list}}
{{ic-tab id="tab1"}}
{{ic-tab id="tab2"}}
{{/ic-tab-list}}
{{#ic-tab-panel}}one{{/ic-tab-panel}}
{{#ic-tab-panel}}two{{/ic-tab-panel}}
*/}.compile()
});
this.append();
var tab1 = Ember.View.views['tab1'];
equal(component.get('activeTab'), tab1);
ok(tab1.get('active'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment