Title: [opsview] [10092] do not relay on getting stringified hash keys in certain order
Revision
10092
Author
aburzynski
Date
2012-09-19 12:44:54 +0100 (Wed, 19 Sep 2012)

Log Message

do not relay on getting stringified hash keys in certain order

Modified Paths


Modified: trunk/opsview-web/t/675-service_status.t
===================================================================
--- trunk/opsview-web/t/675-service_status.t	2012-09-19 10:22:19 UTC (rev 10091)
+++ trunk/opsview-web/t/675-service_status.t	2012-09-19 11:44:54 UTC (rev 10092)
@@ -9,6 +9,7 @@
 use Test::More tests => 16;
 use Test::WWW::Mechanize;
 
+my $data;
 my $url_prefix = "http://localhost:3000";
 
 # Make the command files be real files instead of FIFOs, so we can read them
@@ -30,7 +31,7 @@
 $ua->content_contains( "token", "Should return some ticket information" );
 my $content = $ua->content;
 like( $content, qr%^\{'token' => '[0-9a-f]{40}'\}$%, "Got expected content" );
-my $data = "" $content;
+$data = "" $content;
 like( $data->{token}, qr/^[0-9a-f]{40}$/, "Got token value" );
 
 $ua->add_header( "X-Opsview-Username" => "admin" );
@@ -71,9 +72,35 @@
     `
 );
 is( $ua->status, 200, "Status change submitted OK" );
+$data = "" $ua->content;
 is_deeply(
-    $ua->content,
-    q`{'summary' => {'num_services' => '3','num_hosts' => '0'},'list' => {'hosts' => [],'services' => [{'id' => '148','hostname' => 'cisco','servicename' => 'Another exception'},{'id' => '149','hostname' => 'cisco','servicename' => 'Coldstart'},{'id' => '154','hostname' => 'cisco2','servicename' => 'Another exception'}]}}`,
+    $data,
+    {
+        'summary' => {
+            'num_services' => '3',
+            'num_hosts'    => '0'
+        },
+        'list' => {
+            'hosts'    => [],
+            'services' => [
+                {
+                    'id'          => '148',
+                    'hostname'    => 'cisco',
+                    'servicename' => 'Another exception'
+                },
+                {
+                    'id'          => '149',
+                    'hostname'    => 'cisco',
+                    'servicename' => 'Coldstart'
+                },
+                {
+                    'id'          => '154',
+                    'hostname'    => 'cisco2',
+                    'servicename' => 'Another exception'
+                }
+            ]
+        }
+    },
     "...and responded correctly"
 );
 

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to