Ignore:
Timestamp:
Feb 21, 2009, 6:19:00 PM (13 years ago)
Author:
Dominic Hargreaves
Message:

Correctly paginate search when geodata is supplied (fixes #267) - thanks bob

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/34_search_paging.t

    r956 r1255  
    1717}
    1818
    19 plan tests => 9;
     19plan tests => 18;
    2020
    2121# Clear out the database from any previous runs.
     
    3535    $config->geo_handler( 1 );
    3636
    37     foreach my $i ( 1 .. 30 ) {
     37    foreach my $i ( 1 .. 50 ) {
    3838        OpenGuides::Test->write_data(
    3939                                      guide      => $guide,
     
    5151                                                  os_x => 523500,
    5252                                                  os_y => 177500,
     53                                                 next => 21,
    5354                                                },
    5455                             );
     
    5960    like( $output, qr/search.cgi\?.*os_dist=1500.*Next.*results/s,
    6061          "os_dist retained in next page link" );
     62    like( $output, qr/search.cgi\?.*os_x=523500.*Previous.*results/s,
     63          "os_x retained in previous page link" );
     64    like( $output, qr/search.cgi\?.*os_y=177500.*Previous.*results/s,
     65          "os_y retained in previous page link" );
     66    like( $output, qr/search.cgi\?.*os_dist=1500.*Previous.*results/s,
     67          "os_dist retained in previous page link" );
    6168}
    6269
     
    7178    my $search = OpenGuides::Search->new( config => $config );
    7279
    73     foreach my $i ( 1 .. 30 ) {
     80    foreach my $i ( 1 .. 50 ) {
    7481        OpenGuides::Test->write_data(
    7582                                      guide      => $guide,
     
    8693                                                  osie_x => 100000,
    8794                                                  osie_y => 200000,
     95                                                  next => 21,
    8896                                                },
    8997                             );
     
    94102    like( $output, qr/search.cgi\?.*osie_dist=1500.*Next.*results/s,
    95103          "osie_dist retained in next page link" );
     104    like( $output, qr/search.cgi\?.*osie_x=100000.*Previous.*results/s,
     105          "osie_x retained in previous page link" );
     106    like( $output, qr/search.cgi\?.*osie_y=200000.*Previous.*results/s,
     107          "osie_y retained in previous page link" );
     108    like( $output, qr/search.cgi\?.*osie_dist=1500.*Previous.*results/s,
     109          "osie_dist retained in previous page link" );
    96110}
    97111
     
    106120    my $search = OpenGuides::Search->new( config => $config );
    107121
    108     foreach my $i ( 1 .. 30 ) {
     122    foreach my $i ( 1 .. 50 ) {
    109123        OpenGuides::Test->write_data(
    110124                                      guide      => $guide,
     
    121135                                                  latitude     => 51.5,
    122136                                                  longitude    => -0.12,
     137                                                  next         => 21,
    123138                                                },
    124139                             );
     
    129144    like( $output, qr/search.cgi\?.*latlong_dist=1500.*Next.*results/s,
    130145          "latlong_dist retained in next page link" );
     146    like( $output, qr/search.cgi\?.*latitude=51.5.*Previous.*results/s,
     147          "latitude retained in previous page link" );
     148    like( $output, qr/search.cgi\?.*longitude=-0.12.*Previous.*results/s,
     149          "longitude retained in previous page link" );
     150    like( $output, qr/search.cgi\?.*latlong_dist=1500.*Previous.*results/s,
     151          "latlong_dist retained in previous page link" );
    131152}
Note: See TracChangeset for help on using the changeset viewer.