[otrs-cvs] Survey/scripts/test Survey.t,1.25,1.26

"CVS commits notifications of OTRS.org" <[email protected]> Wed, 26 Jun 2013 13:30:01 +0000
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
--===============1718291050==
Content-Type: text/plain
Content-Encoding: 8bit

Comments:
Update of /home/cvs/Survey/scripts/test
In directory lancelot:/tmp/cvs-serv25865/scripts/test

Modified Files:
	Survey.t 
Log Message:
Extended unittests to check for Survey link mangling during sending process.

Author: jh

Index: Survey.t
===================================================================
RCS file: /home/cvs/Survey/scripts/test/Survey.t,v
retrieving revision 1.25
retrieving revision 1.26
diff -2 -u -d -r1.25 -r1.26
--- Survey.t	22 Nov 2012 13:11:27 -0000	1.25
+++ Survey.t	26 Jun 2013 13:29:56 -0000	1.26
@@ -1,5 +1,5 @@
 # --
 # Survey.t - Survey tests
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -62,5 +62,6 @@
     NotificationSender  => '[email protected]',
     NotificationSubject => 'Help us with your feedback! ÄÖÜ',
-    NotificationBody    => 'Dear customer... äöü',
+    NotificationBody =>
+        'Dear customer... äöü http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=<OTRS_PublicSurveyKey>',
 );
 my $SurveyID = $SurveyObject->SurveyNew(
@@ -363,25 +364,25 @@
 
         # define mail body
-        my $Mailbody1 = "This is a multi-part message in MIME format...
+        my $Mailbody1 = <<'END';
+This is a multi-part message in MIME format...
 
 ------------=_MESSAGEID
-Content-Type: text/plain; charset=\"utf-8\"
+Content-Type: text/plain; charset="utf-8"
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
-Dear customer... =C3=A4=C3=B6=C3=BC=
+Dear customer... =C3=A4=C3=B6=C3=BC
+[1]http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=PublicSurveyKeyID
+
+[1] http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=PublicSurveyKeyID
 
 ------------=_MESSAGEID
-Content-Type: text/html; charset=\"utf-8\"
+Content-Type: text/html; charset="utf-8"
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
-<!DOCTYPE html><html><head><meta http-equiv=3D\"Content-Type\" content=3D\"tex=
-t/html; charset=3Dutf-8\"/></head><body style=3D\"font-family:Geneva,Helvetic=
-a,Arial,sans-serif; font-size: 12px;\">Dear customer... =C3=A4=C3=B6=C3=BC</=
-body></html>=
-
+<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body style="font-family:Geneva,Helvetica,Arial,sans-serif; font-size: 12px;">Dear customer... =C3=A4=C3=B6=C3=BC <a href="http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=PublicSurveyKeyID" title="http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=PublicSurveyKeyID">http://localhost/otrs/public.pl?Action=PublicSurvey;PublicSurveyKey=PublicSurveyKeyID</a></body></html>
 ------------=_MESSAGEID--
-";
+END
 
         # copy mail body
@@ -391,4 +392,13 @@
         $Mailbody2 =~ s{ \d{8,12} - \d{3,6} - \d{1,3} }{MESSAGEID}xmsg;
 
+        # replace mailquoted "=3D" with original "="
+        $Mailbody2 =~ s{\=3D}{=}xmsg;
+
+        # remove trailing "=" linebreaks
+        $Mailbody2 =~ s{\=\n}{}xmsg;
+
+        # replace variable hex MD5 KeyID with "PublicSurveyKeyID"
+        $Mailbody2 =~ s{(PublicSurveyKey\=)[0-9a-f]+}{$1PublicSurveyKeyID}xmsg;
+
         $Self->Is(
             $Mailbody2,

--===============1718291050==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

---------------------------------------------------------------------
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
--===============1718291050==--