Created
October 19, 2010 06:42
-
-
Save abh/633727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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