From 4ef07e2647d7e9b80f18c818873c0e594452fb3b Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 26 Oct 2008 04:17:33 +0000 Subject: [PATCH] check MIME type for JSON accessor methods in Tax and Transaction --- t/Shop/Tax.t | 3 ++- t/Shop/Transaction.t | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/t/Shop/Tax.t b/t/Shop/Tax.t index 3dce75ecb..d0c0bbfe8 100644 --- a/t/Shop/Tax.t +++ b/t/Shop/Tax.t @@ -36,7 +36,7 @@ my $session = WebGUI::Test->session; my $addExceptions = getAddExceptions($session); -my $tests = 79 + 2*scalar(@{$addExceptions}); +my $tests = 80 + 2*scalar(@{$addExceptions}); plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -609,6 +609,7 @@ SKIP: { $session->user({userId=>3}); my $json = $taxer->www_getTaxesAsJson(); ok($json, 'www_getTaxesAsJson returned something'); + is($session->http->getMimeType, 'application/json', 'MIME type set to application/json'); my $jsonTax = JSON::from_json($json); cmp_deeply( $jsonTax, diff --git a/t/Shop/Transaction.t b/t/Shop/Transaction.t index 1a08c8390..4a42a9a65 100644 --- a/t/Shop/Transaction.t +++ b/t/Shop/Transaction.t @@ -30,7 +30,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -plan tests => 65; # Increment this number for each test you create +plan tests => 66; # Increment this number for each test you create #---------------------------------------------------------------------------- # put your tests here @@ -186,6 +186,7 @@ is(scalar @{$transaction->getItems}, 0, "can delete items"); $session->user({userId=>3}); my $json = WebGUI::Shop::Transaction->www_getTransactionsAsJson($session); ok($json, 'www_getTransactionsAsJson returned something'); +is($session->http->getMimeType, 'application/json', 'MIME type set to application/json'); my $jsonTransactions = JSON::from_json($json); cmp_deeply( $jsonTransactions,