Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 19aec69

Nav-Menu:

Added a test to the site map tests to test the url_is_abs functionality.

  • Participants
  • Parent commits 7588e2c

Comments (0)

Files changed (2)

 
 * Write tests to test the url_is_abs propagation in the leading path, site-map,
 and navigation links. Implement them if necessary.
+    - Done leading_path.
 
 * Document url_is_abs.
 

File module/t/02site-map.t

 
 use strict;
 
-use Test::More tests => 5;
+use Test::More tests => 6;
 
 use HTML::Widgets::NavMenu;
 
     ok (validate_site_map($results, $expected_text), 
         "site_map - rec_url_type");
 }
+
+
+
+
+
+
+# This is a test for the url_is_abs directive.
+{
+    my $nav_menu = HTML::Widgets::NavMenu->new(
+        'path_info' => "/darling/",
+        @{$test_data->{'url_is_abs_menu'}},
+    );
+
+    my $results = $nav_menu->gen_site_map();
+
+    my $expected_text = <<"EOF";
+<ul>
+<li>
+<a href="../">Home</a>
+</li>
+<li>
+<a href="http://www.google.com/" title="Google it!">Link to Google</a> - Google it!
+<br />
+<ul>
+<li>
+<a href="../sub-dir/">Sub Directory</a>
+</li>
+</ul>
+</li>
+</ul>
+EOF
+    # TEST
+    ok (validate_site_map($results, $expected_text), 
+        "site_map - url_is_abs");
+}