| 1 |
$(document).ready(function() { |
| 2 |
|
| 3 |
QUnit.testStart = function() { |
| 4 |
window.view = new (Backbone.View.extend({ |
| 5 |
model: null, |
| 6 |
templateId: '', |
| 7 |
render: function() { |
| 8 |
var html = document.getElementById(this.templateId).innerHTML; |
| 9 |
this.$el.html(_.template(html)()); |
| 10 |
this.stickit(); |
| 11 |
return this; |
| 12 |
} |
| 13 |
}))(); |
| 14 |
|
| 15 |
window.model = new (Backbone.Model.extend())(); |
| 16 |
}; |
| 17 |
|
| 18 |
QUnit.testDone = function() { |
| 19 |
model.off(); |
| 20 |
delete window.model; |
| 21 |
view.remove(); |
| 22 |
delete window.view; |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
window.getSelectedOption = function($el) { |
| 27 |
return $el.find('option').not(function(){ return !this.selected; }); |
| 28 |
}; |
| 29 |
|
| 30 |
}); |