Changeset 899


Ignore:
Timestamp:
Dec 9, 2006, 2:41:19 PM (15 years ago)
Author:
nick
Message:

Add in skips if no Helmert Transform provider is found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/53_show_index.t

    r872 r899  
    9797
    9898    # Test the map version
     99    # They will need a Helmert Transform provider for this to work
    99100    $config->gmaps_api_key("yes I have one");
    100101    $config->geo_handler(1);
    101102    $config->force_wgs84(0);
    102     $output = eval {
    103         $guide->show_index(
    104                             return_output => 1,
    105                             format        => "map",
    106                           );
     103
     104    my $has_helmert = 0;
     105    eval {
     106        use OpenGuides::Utils;
     107        $has_helmert = OpenGuides::Utils->get_wgs84_coords(latitude=>1,longitude=>1,config=>$config);
    107108    };
    108     is( $@, "", "->show_index doesn't die when asked for map" );
    109     like( $output, qr|Content-Type: text/html|,
    110           "Map output gets content-type of text/html" );
    111     like( $output, qr|new GMap|, "Really is google map" );
    112     my @points = ($output =~ /point\d+ = (new GPoint\(.*?, .*?\))/g);
    113     is( 1, scalar @points, "Right number of nodes included on map" );
    114109
    115     # -1.259687,51.754813
    116     like( $points[0], qr|51.75481|, "Has latitude");
    117     like( $points[0], qr|-1.25968|, "Has longitude");
     110    SKIP: {
     111        skip "No Helmert Transform provider installed, can't test geo stuff", 6
     112          unless $has_helmert;
     113
     114        $output = eval {
     115            $guide->show_index(
     116                                return_output => 1,
     117                                format        => "map",
     118                              );
     119        };
     120        is( $@, "", "->show_index doesn't die when asked for map" );
     121        like( $output, qr|Content-Type: text/html|,
     122              "Map output gets content-type of text/html" );
     123        like( $output, qr|new GMap|, "Really is google map" );
     124        my @points = ($output =~ /point\d+ = (new GPoint\(.*?, .*?\))/g);
     125        is( 1, scalar @points, "Right number of nodes included on map" );
     126
     127        # -1.259687,51.754813
     128        like( $points[0], qr|51.75481|, "Has latitude");
     129        like( $points[0], qr|-1.25968|, "Has longitude");
     130    }
    118131}
Note: See TracChangeset for help on using the changeset viewer.