Fixed bug where ResponseJSON was not properly resetting between

tests. Refactored out reset() sub to make it easy for people to
achieve reliable resetting of rJSON objects.
This commit is contained in:
Patrick Donelan 2009-05-21 08:21:17 +00:00
parent 206a45e7c2
commit 8baf09948e
3 changed files with 71 additions and 29 deletions

View file

@ -21,7 +21,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 67;
plan tests => 70;
my ( $s, $t1 );
@ -392,6 +392,48 @@ try_it( $t1, $spec, { tap => <<END_TAP } );
ok 1 - Checking tagged on page containing Section S1 Question S1Q0
END_TAP
# Check that the tags disappear between tests
$spec = <<END_SPEC;
[
{
"test" : {
"S1Q0" : "n", # sets a tag of its own
"setup" : { tag: [ "my test tag", { "my data tag": 1.5 } ] },
"page" : { S0Q0: "y" }, # make sure this doesn't get overwritten
"tagged" : [ 'tagged at S0Q0', { 'tagged at S1Q0' : 999 }, "my test tag", { "my data tag": 1.5 } ],
}
},
{
"test" : {
"S1Q0" : "y",
"tagged" : [ 'tagged at S0Q0'],
}
},
{
"test" : {
"S1Q0" : "y",
"tagged" : [ 'tagged at S1Q0',],
}
},
{
"test" : {
"S1Q0" : "y",
"tagged" : [ "my data tag" ],
}
},
]
END_SPEC
try_it( $t1, $spec, { tap => <<END_TAP, fail => 1 } );
1..4
ok 1 - Checking tagged on page containing Section S1 Question S1Q0
not ok 2 - Checking tagged on page containing Section S1 Question S1Q0
# Tag not found: tagged at S0Q0
not ok 3 - Checking tagged on page containing Section S1 Question S1Q0
# Tag not found: tagged at S1Q0
not ok 4 - Checking tagged on page containing Section S1 Question S1Q0
# Tag not found: my data tag
END_TAP
#########
# test_mc
#########