Skip to content

Instantly share code, notes, and snippets.

@abh
Created October 19, 2010 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abh/633727 to your computer and use it in GitHub Desktop.
Save abh/633727 to your computer and use it in GitHub Desktop.
diff --git a/t/hello.mhtml b/t/hello.mhtml
index f36c488..02c01f6 100644
--- a/t/hello.mhtml
+++ b/t/hello.mhtml
@@ -2,3 +2,8 @@
Hello World <% $var %>
<% do { join ",", $r->params } %>
+<%perl>
+ if ($ARGS{403}) {
+ $m->status(403);
+ }
+</%perl>
diff --git a/t/hello.t b/t/hello.t
index d38459c..8ae22b2 100644
--- a/t/hello.t
+++ b/t/hello.t
@@ -14,8 +14,13 @@ my $handler = sub { $h->handle_psgi(@_) };
test_psgi app => $handler, client => sub {
my $cb = shift;
my $res = $cb->(HTTP::Request->new(GET => "http://localhost/hello.mhtml?foo=bar"));
+ is $res->code, 200, 'got 200 response';
like $res->content, qr/Hello World Foo/;
like $res->content, qr/foo,bar/;
+
+ $res = $cb->(HTTP::Request->new(GET => "http://localhost/hello.mhtml?403=1"));
+ is $res->code, 403, 'got 403 response';
+
};
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment