Skip to content

Commit

Permalink
No more leaky tests for carts.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Nov 5, 2011
1 parent 8a92be9 commit 3bd5172
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/Asset/Sku/EMSRibbon.t
Expand Up @@ -50,6 +50,7 @@ $mech->submit_form_ok({
});

my $cart = WebGUI::Shop::Cart->newBySession( $mech->session );
WebGUI::Test->addToCleanup($cart);
ok( $cart->getItemsByAssetId([ $ribbon->getId ])->[0]->getId, $ribbon->getId );


Expand Down
1 change: 1 addition & 0 deletions t/Asset/Sku/EMSTicket.t
Expand Up @@ -50,6 +50,7 @@ $mech->submit_form_ok({
});

my $cart = WebGUI::Shop::Cart->newBySession( $mech->session );
WebGUI::Test->addToCleanup($cart);
ok( $cart->getItemsByAssetId([ $ticket->getId ])->[0]->getId, $ticket->getId );


Expand Down
1 change: 1 addition & 0 deletions t/Asset/Sku/EMSToken.t
Expand Up @@ -50,6 +50,7 @@ $mech->submit_form_ok({
});

my $cart = WebGUI::Shop::Cart->newBySession( $mech->session );
WebGUI::Test->addToCleanup($cart);
ok( $cart->getItemsByAssetId([ $token->getId ])->[0]->getId, $token->getId );


Expand Down
7 changes: 7 additions & 0 deletions t/Asset/Sku/Product.t
Expand Up @@ -212,6 +212,8 @@ $mech->submit_form_ok({
},
}, 'add viewProduct and go back' );

WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
$product->getAllCollateral( 'accessoryJSON' ),
Expand Down Expand Up @@ -246,6 +248,7 @@ $mech->submit_form_ok({
proceed => 0,
},
}, 'add viewProduct and go back' );
WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
Expand Down Expand Up @@ -281,6 +284,7 @@ $mech->submit_form_ok({
proceed => 0,
},
}, 'add one more new benefit' );
WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
Expand Down Expand Up @@ -338,6 +342,7 @@ $mech->submit_form_ok({
proceed => 0,
},
}, 'add one more new feature' );
WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
Expand Down Expand Up @@ -401,6 +406,7 @@ $mech->submit_form_ok({
proceed => 0,
},
}, 'add one more new feature' );
WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
Expand Down Expand Up @@ -475,6 +481,7 @@ $mech->submit_form_ok({
proceed => 0,
},
}, 'add one more new variant' );
WebGUI::Test->addToCleanup(WebGUI::Shop::Cart->newBySession($mech->session));

$product = $product->cloneFromDb;
cmp_deeply(
Expand Down

0 comments on commit 3bd5172

Please sign in to comment.