[Jifty-commit] r1769 - in jifty/trunk: . t/TestApp/share/web/templates

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Aug 6 15:16:57 EDT 2006


Author: jesse
Date: Sun Aug  6 15:16:57 2006
New Revision: 1769

Added:
   jifty/trunk/t/TestApp/share/web/templates/manual_redirect
   jifty/trunk/t/TestApp/t/09-redirect.t   (contents, props changed)
Modified:
   jifty/trunk/   (props changed)

Log:
 r15005 at pinglin:  jesse | 2006-08-06 15:05:10 -0400
 * Added explicit tests for Jifty::Action::Redirect


Added: jifty/trunk/t/TestApp/share/web/templates/manual_redirect
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/share/web/templates/manual_redirect	Sun Aug  6 15:16:57 2006
@@ -0,0 +1,13 @@
+<%init>
+my $action = Jifty->web->new_action(
+    class => 'Jifty::Action::Redirect',
+    moniker => 'go',
+);
+</%init>
+<&| /_elements/wrapper, title => "Test of simple form for editing" &>
+  Basic test of a simple form for editing.
+<% Jifty->web->form->start() %>
+<% $action->form_field('url') %>
+<% Jifty->web->form->submit %>
+<% Jifty->web->form->end %>
+</&>

Added: jifty/trunk/t/TestApp/t/09-redirect.t
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/t/09-redirect.t	Sun Aug  6 15:16:57 2006
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+If we do a redirect in a 'before' in the dispatcher, actions should
+still get run.
+
+=cut
+
+BEGIN {chdir "t/TestApp"}
+use lib '../../lib';
+use Jifty::Test tests => 6;
+use Jifty::Test::WWW::Mechanize;
+
+my $server  = Jifty::Test->make_server;
+
+isa_ok($server, 'Jifty::Server');
+
+my $URL     = $server->started_ok;
+my $mech    = Jifty::Test::WWW::Mechanize->new();
+
+$mech->get_ok("$URL/manual_redirect", "Got redirect");
+
+$mech->fill_in_action_ok('go', url => $URL."/index.html");
+$mech->submit_html_ok();
+like($mech->uri, qr|/index.html|, "At index");
+
+1;
+


More information about the Jifty-commit mailing list