Hi,
I'm trying to compare two subtrees of nodes; one gets inserted
dynamically by the code from a Ajax response. I've drilled this down
to the smallest possible example that fails. Can someone enlighten me
why the following fails with:
expected selector "#container" to eql undefined
spec.experiment.js:
describe "Compare elements"
it 'inserts the returned HTML snippet'
new_div = $('<div id="container"><p>Payload</p></div>')
new_div.appendTo('body')
$('#container').should.eql new_div
end
end
spec.experiment.dom.html:
<html>
<head>
<link href="lib/jspec.css" type="text/css"
rel="stylesheet" />
<script src="../public/javascripts/jquery-1.4.2.min.js"
type="text/javascript"></script>
<script src="lib/jspec.js" type="text/javascript"></
script>
<script src="lib/jspec.jquery.js" type="text/javascript"></
script>
<script src="lib/jspec.xhr.js" type="text/javascript"></
script>
<script src="../public/javascripts/quidget.first.js"
type="text/javascript"></script>
<script>
function runSuites() {
JSpec
.exec('spec.experiment.js')
.run({verbose: true, fixturePath: 'fixtures'})
.report()
}
</script>
</head>
<body class="jspec" onLoad="runSuites();">
<div id="jspec-top"><h2 id="jspec-title">JSpec
<em><script>document.write(JSpec.version)</script></em></h2></div>
<div id="jspec"></div>
<div id="jspec-bottom"></div>
</body>
</html>
--
JSpec thanks you for your interest and support! To post simply reply
to this email.
documentation:
http://jspec.info
unsubscribe:
jspec+un...@googlegroups.com
group:
http://groups.google.com/group/jspec