Last active
August 29, 2015 13:56
-
-
Save ryanflorence/9318497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://twitter.com/followchrisp/status/440397431868370945