Author: kake Date: 2012-04-27 14:37:06 +0100 (Fri, 27 Apr 2012) New Revision: 1366
Modified: trunk/t/33_search_advanced_search.t trunk/templates/search.tt Log: Stopped spurious 'score' output for non-scored search results.
Modified: trunk/t/33_search_advanced_search.t =================================================================== --- trunk/t/33_search_advanced_search.t 2012-04-27 09:52:18 UTC (rev 1365) +++ trunk/t/33_search_advanced_search.t 2012-04-27 13:37:06 UTC (rev 1366) @@ -18,12 +18,11 @@ }
-plan tests => 8; +plan tests => 9;
# Clear out the database from any previous runs. +OpenGuides::Test::refresh_db();
- OpenGuides::Test::refresh_db(); - my $config = OpenGuides::Config->new( vars => { dbtype => "sqlite", @@ -100,6 +99,15 @@ is_deeply( @ordered, [ "Crabtree Tavern", "Hammersmith Bridge", "Blue Anchor" ], "...and returns them in the right order" ); +my $output = $search->run( + return_output => 1, + vars => { + latitude => 51.484320, + longitude => -0.223484, + latlong_dist => 1000, + }, + ); +unlike( $output, qr|(score:\s+)|, "...no spurious 'scores' printed" );
%tt_vars = $search->run( return_tt_vars => 1,
Modified: trunk/templates/search.tt =================================================================== --- trunk/templates/search.tt 2012-04-27 09:52:18 UTC (rev 1365) +++ trunk/templates/search.tt 2012-04-27 13:37:06 UTC (rev 1366) @@ -66,7 +66,10 @@ <ol start="[% first_num %]"> [% FOREACH result = results %] <li> - <a href="[% result.url %]"><b>[% result.name %]</b></a> (score: [% result.score %]) + <a href="[% result.url %]"><b>[% result.name %]</b></a> + [% IF result.score %] + (score: [% result.score %]) + [% END %] [% IF result.distance %] ([% result.distance %] metres away) [% END %][% IF result.summary %]
openguides-commits@lists.openguides.org