appended lastDocument to the document.body

This commit is contained in:
Andres Ornelas 2010-05-25 09:52:52 -07:00
parent 55c0767f16
commit 4fec828cf6

View file

@ -11,6 +11,7 @@ describe("DSL", function() {
}; };
executeStep = function(step, html, callback) { executeStep = function(step, html, callback) {
lastDocument =_jQuery('<div>' + html + '</div>'); lastDocument =_jQuery('<div>' + html + '</div>');
_jQuery(document.body).append(lastDocument);
var specThis = { var specThis = {
testWindow: window, testWindow: window,
testDocument: lastDocument testDocument: lastDocument
@ -32,8 +33,10 @@ describe("DSL", function() {
it('should select', function() { it('should select', function() {
input('gender').select('female'); input('gender').select('female');
expect(lastStep.name).toEqual("Select radio 'gender' to 'female'"); expect(lastStep.name).toEqual("Select radio 'gender' to 'female'");
executeStep(lastStep, '<input type="radio" name="0@gender" value="male"/>' + executeStep(lastStep,
'<input type="radio" name="0@gender" value="male" checked/>' +
'<input type="radio" name="0@gender" value="female"/>'); '<input type="radio" name="0@gender" value="female"/>');
expect(lastDocument.find(':radio:checked').length).toEqual(1);
expect(lastDocument.find(':radio:checked').val()).toEqual('female'); expect(lastDocument.find(':radio:checked').val()).toEqual('female');
}); });
}); });