diff options
author | Eric Wong <e@80x24.org> | 2016-07-07 01:39:37 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-07 01:44:10 +0000 |
commit | a380c9b55b39a4db6a21131332a2a5629428dded (patch) | |
tree | 9a279e2b0809cda1ff978a3f584c5da7b4ac8608 /t | |
parent | 8e85257577ee4d7d49e59f048852d9d4ac6f8172 (diff) | |
download | public-inbox-a380c9b55b39a4db6a21131332a2a5629428dded.tar.gz |
We now generate all of our HTML using WwwStream which forces us to have consistent headers and footers in the HTML itself. This also makes the search-capable vs search-less installs go to the new.html endpoint to maintain consistency (in case an admin decides to enable Xapian).
Diffstat (limited to 't')
-rw-r--r-- | t/cgi.t | 17 | ||||
-rw-r--r-- | t/html_index.t | 16 | ||||
-rw-r--r-- | t/plack.t | 4 |
3 files changed, 3 insertions, 34 deletions
@@ -131,21 +131,6 @@ EOF like($res->{body}, qr/what\?/, "reply included"); } -# indices -{ - local $ENV{HOME} = $home; - my $res = cgi_run("/test/"); - like($res->{head}, qr/Status: 200 OK/, "index returns 200"); - - my $idx = cgi_run("/test/index.html"); - $idx->{body} =~ s!/index.html(\?r=)!/$1!g; # dirty... - $idx->{body} = [ split(/\n/, $idx->{body}) ]; - $res->{body} = [ split(/\n/, $res->{body}) ]; - is_deeply($res, $idx, - '/$INBOX/ and /$INBOX/index.html are nearly identical'); - # more checks in t/feed.t -} - # message-id pages { local $ENV{HOME} = $home; @@ -187,7 +172,7 @@ EOF $res = cgi_run("/test/blahblah\@example.con/"); like($res->{head}, qr/Status: 300 Multiple Choices/, "mid html miss"); - $res = cgi_run("/test/"); + $res = cgi_run("/test/new.html"); like($res->{body}, qr/slashy%2Fasdf%40example\.com/, "slashy URL generated correctly"); } diff --git a/t/html_index.t b/t/html_index.t index 100d21a8..f29b442d 100644 --- a/t/html_index.t +++ b/t/html_index.t @@ -26,11 +26,6 @@ my $im = PublicInbox::Import->new($git, 'tester', 'test@example'); my $prev = ""; foreach my $i (1..6) { - # my $pid = open(my $pipe, "|-"); - # defined $pid or die "fork/pipe failed: $!\n"; - # if ($pid == 0) { - # exec("ssoma-mda", $git_dir); - # } my $mid = "<$i\@example.com>"; my $mid_line = "Message-ID: $mid"; if ($prev) { @@ -58,15 +53,4 @@ EOF $im->done; } -# check HTML index -{ - use IO::File; - my $cb = PublicInbox::Feed::generate_html_index({ - -inbox => $ibx, - max => 3 - }); - require 't/common.perl'; - like(stream_to_string($cb), qr/html/, "feed is valid HTML :)"); -} - done_testing(); @@ -120,9 +120,9 @@ EOF test_psgi($app, sub { my ($cb) = @_; my $atomurl = 'http://example.com/test/new.atom'; - my $res = $cb->(GET('http://example.com/test/')); + my $res = $cb->(GET('http://example.com/test/new.html')); is(200, $res->code, 'success response received'); - like($res->content, qr!href="\Q$atomurl\E"!, + like($res->content, qr!href="new\.atom"!, 'atom URL generated'); like($res->content, qr!href="blah%40example\.com/"!, 'index generated'); |