[omd-commits] OMD Git: omd: add test for thruks startup page

git version control git at mathias-kettner.de
Sat Sep 6 18:11:13 CEST 2014


Module:   omd
Branch:   master
Commit:   de07886b691d78d2f0fb9c465b264c55e02a65df
URL:      http://omdistro.org/projects/omd/repository/revisions/de07886b691d78d2f0fb9c465b264c55e02a65df

Author:   Sven Nierlein <Sven.Nierlein at consol.de>
Date:     Fri Sep  5 16:47:09 2014 +0200
Commiter: Sven Nierlein <Sven.Nierlein at consol.de>
Date:     Sat Sep  6 17:12:15 2014 +0200

add test for thruks startup page

Signed-off-by: Sven Nierlein <Sven.Nierlein at consol.de>

---

 t/20-package_thruk.t |    3 ++-
 t/TestUtils.pm       |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/20-package_thruk.t b/t/20-package_thruk.t
index ce8a22c..d593685 100644
--- a/t/20-package_thruk.t
+++ b/t/20-package_thruk.t
@@ -13,7 +13,7 @@ BEGIN {
     use lib "$FindBin::Bin/lib/lib/perl5";
 }
 
-plan( tests => 2805 );
+plan( tests => 2853 );
 
 ##################################################
 # create our test site
@@ -104,6 +104,7 @@ my $urls = [
   { url => "/thruk/side.html",       like => '/<title>Thruk<\/title>/' },
   { url => "",                       like => '/<title>Thruk<\/title>/' },
   { url => "/thruk/index.html",      like => '/<title>Thruk<\/title>/' },
+  { url => "/thruk/startup.html",    like => '/<title>Thruk Monitoring Webinterface<\/title>/' },
   { url => "/thruk/docs/index.html", like => '/<title>Documentation<\/title>/' },
   { url => "/thruk/main.html",       like => '/<title>Thruk Monitoring Webinterface<\/title>/' },
 
diff --git a/t/TestUtils.pm b/t/TestUtils.pm
index a05cf8a..43fa3af 100644
--- a/t/TestUtils.pm
+++ b/t/TestUtils.pm
@@ -310,6 +310,7 @@ sub test_url {
 
     # matches output?
     if(defined $test->{'like'}) {
+        defined $page->{'content'} or _diag_request($test, $page);
         for my $expr (ref $test->{'like'} eq 'ARRAY' ? @{$test->{'like'}} : $test->{'like'} ) {
             like($page->{'content'}, $expr, "content like ".$expr);
         }
@@ -675,7 +676,7 @@ sub _request {
 
     $return->{'response'}     = $response;
     $return->{'code'}         = $response->code;
-    $return->{'content'}      = $response->decoded_content;
+    $return->{'content'}      = $response->decoded_content || $response->content;
     $return->{'content_type'} = $response->header('Content-Type');
 
     return($return);



More information about the omd-commits mailing list