Sort the tests out..
Tomas Doran [Wed, 20 Jan 2010 21:38:51 +0000 (21:38 +0000)]
lib/Gitalist/Controller/Repository.pm
root/nav/search.tt2
root/wrapper.tt2
t/01app.t

index c07fe88..53cf1a9 100644 (file)
@@ -22,7 +22,7 @@ sub search : Chained('find') Args(0) {
   my $repository = $c->stash->{Repository};
   # Lifted from /shortlog.
   my %logargs = (
-#    sha1   => $commit->sha1,
+    sha1   => $repository->head_hash,
 #    count  => Gitalist->config->{paging}{log},
 #    ($c->req->param('f') ? (file => $c->req->param('f')) : ()),
     search => {
index 35c3d88..8325f72 100644 (file)
@@ -1,9 +1,5 @@
 <div id="page-search">
-  <form method="get" action="[% c.uri_for('search') %]" enctype="application/x-www-form-urlencoded">
-  <input name="p" type="hidden" value="[% Repository.name %]">
-  <input name="a" type="hidden" value="search">
-  <input name="h" type="hidden" value="[% commit.sha1 %]">
-  <input name="f" type="hidden" value="[% c.req.param('f') %]">
+  <form method="get" action="[% c.uri_for_action('/repository/search', [Repository.name]) %]" enctype="application/x-www-form-urlencoded">
   <select name="type">
       <option value="commit">commit</option>
       <option value="author">author</option>
@@ -12,7 +8,7 @@
       <option value="grep">grep</option>
       <option value="pickaxe">pickaxe</option>
       -->
-  </select><sup><a href="[% c.uri_for('search_help') %]">?</a></sup> search:
+  </select><sup><a href="[% c.uri_for_action('/search_help') %]">?</a></sup> search:
   <input type="text" name="text" value="[% c.req.param('s') %]">
   <span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1">re</label></span>
   </form>
index 0feb8de..fafed4f 100644 (file)
@@ -6,13 +6,13 @@
   <meta charset="utf-8">
   <meta name="generator" content="gitweb/[% version %] git/[% git_version %][% mod_perl_version %]">
   <meta name="robots" content="index, nofollow">
-  <title>[%-
+  <title>[%# FIXME - MING %][%-
     title = BLOCK;
       c.config.sitename;
       IF Repository; ' - ' _ Repository.name | html; END;
-      IF action;  ' / ' _ action; END;
+      IF c.action;  ' / ' _ c.action; END;
       IF filename; ' - ' _ filename | html; END;
-      IF action && action == 'tree'; '/'; END;
+      IF c.action && c.action == 'tree'; '/'; END;
     END;
     title;
   -%] (Gitalist)</title>
   <a title="git homepage" href="http://git-scm.org">
    <img src="[% c.uri_for('/logo.png') %]" alt="git" class="logo">
   </a>
-  <a href="[% c.uri_for('/', {p=''}) %]">A Gitalist</a>
+  <a href="[% c.uri_for('/') %]">A Gitalist</a>
   [%- IF Repository %]
-  / <a href="[% c.uri_for('summary') %]">[% Repository.name %]</a>
-  [% IF action;  " / " _ action; END;
-  END %]
+  / <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]">[% Repository.name %]</a>
+  [% END %]
 [%
   IF Repository;
     INCLUDE 'nav/search.tt2';
index 324a3bc..57dba80 100644 (file)
--- a/t/01app.t
+++ b/t/01app.t
@@ -27,20 +27,25 @@ like $response->content, qr/Page not found/, 'invalid repository handled correct
   test('shortlog');
   test('log');
   test('reflog');
-  test('commit');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1');
+  test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2');
+  
   TODO: {
       local $TODO = "FIXME";
-  test('commitdiff', 'h=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
-  test('tree', 'h=145dc3ef5d307be84cb9b325d70bd08aeed0eceb;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
-  test('search', 'type=commit&text=added');
-  test('blobdiff', 'f=file1;h=5716ca5987cbf97d6bb54920bea6adde242d87e6;hp=257cc5642cb1a054f08cc83f2d943e56fd3ebe99;hb=refs/heads/master;hpb=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
-  test('blob', 'f=dir1/file2;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
-  test('patch');
-  test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
-  test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
-  test('patches');
-  test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
-  test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
+      test('search', 'type=commit&text=added');
+
+
+      test('blob', 'f=dir1/file2;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
+
+      # FIXME - What's the difference here?
+      #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
+      #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
+      #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
+      #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
   }
 }