From aa41217a463e1bc0ba21bb3e4c8b36e87bfad99a Mon Sep 17 00:00:00 2001 From: franck cuny Date: Tue, 19 Oct 2010 21:59:07 +0200 Subject: new middlewares: * fileupload: upload a file (will detect mime type to set appropriate headers) * paranoidagent: handle blacklist and whitelist * redirection: follows HTTP redirection (HTTP status 30*) * test for redirection --- t/spore-middleware/redirection.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t/spore-middleware/redirection.t (limited to 't/spore-middleware') diff --git a/t/spore-middleware/redirection.t b/t/spore-middleware/redirection.t new file mode 100644 index 0000000..0084956 --- /dev/null +++ b/t/spore-middleware/redirection.t @@ -0,0 +1,27 @@ +use strict; +use warnings; + +use Test::More; + +plan tests => 2; + +use Net::HTTP::Spore; + +SKIP: { + skip "require RUN_HTTP_TEST", 2 unless $ENV{RUN_HTTP_TEST}; + my $client = Net::HTTP::Spore->new_from_string( + '{ + "base_url" : "http://fperrad.googlepages.com", + "name" : "googlepages", + "methods" + : { "get_home" + : { "path" : "/home", "method" : "GET", "expected_status" : [200] } } + }'); + + $client->enable(' Redirection '); + + my $r = $client->get_home(); + is $r->status, 200; + is $r->request->uri, + 'http://sites.google.com/site/fperrad/home '; +} -- cgit 1.4.1