[Jifty-commit] r3325 - in jifty/trunk/t/TestApp: lib/TestApp

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jun 2 17:42:16 EDT 2007


Author: clkao
Date: Sat Jun  2 17:42:15 2007
New Revision: 3325

Modified:
   jifty/trunk/t/TestApp/lib/TestApp/View.pm
   jifty/trunk/t/TestApp/t/16-template-region.t

Log:
really correct the test.

Modified: jifty/trunk/t/TestApp/lib/TestApp/View.pm
==============================================================================
--- jifty/trunk/t/TestApp/lib/TestApp/View.pm	(original)
+++ jifty/trunk/t/TestApp/lib/TestApp/View.pm	Sat Jun  2 17:42:15 2007
@@ -69,7 +69,7 @@
     outs('list!');
     show('/foo/item', { id => 1 } );
     show('/foo/item', { id => 2 } );
-    render_region('special', path => '/foo/item', defaults => { id => 2 } );
+    render_region('special', path => '/foo/item', defaults => { id => 3 } );
 };
 
 template '/foo/item' => sub {

Modified: jifty/trunk/t/TestApp/t/16-template-region.t
==============================================================================
--- jifty/trunk/t/TestApp/t/16-template-region.t	(original)
+++ jifty/trunk/t/TestApp/t/16-template-region.t	Sat Jun  2 17:42:15 2007
@@ -11,18 +11,15 @@
 my @tests = (
     {
         url  => "/foo/list",
-        text => 'list!<span>1</span>
-<span>2</span>'.in_region('<span>3</span>'),
+        text => q|list!<span>1</span>
+<span>2</span><script type="text/javascript">
+new Region('special',{'id':3},'/foo/item',null);
+</script><div id="region-special">
+<span>3</span></div>|
     },
 
 );
 
-sub in_region {
-    qq|<script type="text/javascript">
-new Region('$_[0]',{},'$_[1]',null);
-</script><div id="region-$_[0]">$_[2]</div>|;
-}
-
 plan tests => 2 + scalar(@tests) * 2;
 
 my $server = Jifty::Test->make_server;
@@ -33,7 +30,7 @@
 my $mech = Jifty::Test::WWW::Mechanize->new;
 foreach my $test (@tests) {
     $mech->get_ok( $URL . $test->{url}, "get '$URL: /jifty/jifty/trunk/t/TestApp/t/15-template-subclass.t $test->{url}'" );
-
+#    diag $mech->content;
     $mech->content_like(qr{$test->{text}}, "found the test content");
 }
 


More information about the Jifty-commit mailing list