[otrs-cvs] otrs/scripts/test/Frontend Basic.t,1.2,1.3

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/scripts/test/Frontend
In directory lancelot:/tmp/cvs-serv23708/scripts/test/Frontend

Modified Files:
	Basic.t 
Log Message:
Add JSON test decoding.

Author: mg

Index: Basic.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/Frontend/Basic.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -2 -u -d -r1.2 -r1.3
--- Basic.t	14 Jan 2013 08:05:20 -0000	1.2
+++ Basic.t	4 Feb 2013 09:26:01 -0000	1.3
@@ -24,4 +24,5 @@
 use Kernel::Config;
 use Kernel::System::UnitTest::Helper;
+use Kernel::System::JSON;
 
 my $ConfigObject = Kernel::Config->new();
@@ -38,4 +39,6 @@
 my $TestCustomerUserLogin = $HelperObject->TestCustomerUserCreate();
 
+my $JSONObject = Kernel::System::JSON->new( %{$Self} );
+
 my $BaseURL = $ConfigObject->Get('HttpType') . '://';
 
@@ -115,4 +118,14 @@
             "Module $Frontend is no OTRS login screen",
         );
+
+        # Check JSON response
+        if ( $Response->header('Content-type') =~ 'json' ) {
+            my $Data = $JSONObject->Decode( Data => $Response->content() );
+
+            $Self->True(
+                scalar $Data,
+                "Module $Frontend returned valid JSON data",
+            );
+        }
     }
 }
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.