change filter_response to response_filter in the places I got it wrong
[catagits/Web-Simple.git] / t / bloggery.t
CommitLineData
957088cd 1use strict;
2use warnings FATAL => 'all';
3use Test::More (
4 eval { require HTTP::Request::AsCGI }
5 ? 'no_plan'
6 : (skip_all => 'No HTTP::Request::AsCGI')
7);
8
9
10use HTTP::Request::Common qw(GET POST);
11
12require 'examples/bloggery/bloggery.cgi';
13
14my $app = Bloggery->new(
15 { config => { posts_dir => 'examples/bloggery/posts' } }
16);
17
18sub run_request {
19 my $request = shift;
20 my $c = HTTP::Request::AsCGI->new($request)->setup;
21 $app->run;
22 $c->restore;
23 return $c->response;
24}
25
26my $res;
27
39119082 28warn run_request(GET 'http://localhost/index.html')->as_string;
957088cd 29
39119082 30warn run_request(GET 'http://localhost/')->as_string;
957088cd 31
32warn run_request(GET 'http://localhost/One-Post.html')->as_string;
33
34warn run_request(GET 'http://localhost/Not-There.html')->as_string;
35
36warn run_request(POST 'http://localhost/One-Post.html')->as_string;