Skip to content

Instantly share code, notes, and snippets.

@sebs
Created June 27, 2012 13:03
Show Gist options
  • Save sebs/3003947 to your computer and use it in GitHub Desktop.
Save sebs/3003947 to your computer and use it in GitHub Desktop.
buster document.fail?
buster.testCase("modSource.getHtmlWithoutScripts", {
"setUp": function () {
$jt = jQuery.noConflict();
var res = $jt.ajax('simple', {async:false, cache:false}).responseText;
document.open('text/html', 'replace');
document.write(res);
document.close();
this.doc = document;
},
"has function": function () {
refute.equals(modSource.getHtmlWithoutScripts, "undefined");
},
"returns a string": function() {
assert.equals("string", typeof modSource.getHtmlWithoutScripts(this.doc));
},
"return has no script tag": function() {
res = modSource.getHtmlWithoutScripts(this.doc);
assert.equals(res.search('script'), -1);
assert.equals(res.search('SCRIPT'), -1);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment