[Jifty-commit] r3455 - in jifty/trunk/t/TestApp: lib/TestApp t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Jun 12 12:34:31 EDT 2007
Author: clkao
Date: Tue Jun 12 12:34:29 2007
New Revision: 3455
Modified:
jifty/trunk/t/TestApp/lib/TestApp/View.pm
jifty/trunk/t/TestApp/lib/TestApp/View/base.pm
jifty/trunk/t/TestApp/lib/TestApp/View/instance.pm
jifty/trunk/t/TestApp/t/15-template-subclass.t
Log:
Fix the template subclassing tests.
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 Tue Jun 12 12:34:29 2007
@@ -44,8 +44,8 @@
require TestApp::View::base;
require TestApp::View::instance;
-import_templates TestApp::View::base under '/base';
-import_templates TestApp::View::instance under '/instance';
+alias TestApp::View::base under '/base';
+alias TestApp::View::instance under '/instance';
use Jifty::View::Declare::CRUD;
Modified: jifty/trunk/t/TestApp/lib/TestApp/View/base.pm
==============================================================================
--- jifty/trunk/t/TestApp/lib/TestApp/View/base.pm (original)
+++ jifty/trunk/t/TestApp/lib/TestApp/View/base.pm Tue Jun 12 12:34:29 2007
@@ -1,11 +1,13 @@
package TestApp::View::base;
use Jifty::View::Declare -base;
+sub base_path { '/base' }
+
template 'list_ht' => sub {
my $self = shift;
outs("/base/list=$self");
for (0..1) {
- $self->has_template('view')->();
+ $self->resolve_template('view')->();
}
};
@@ -13,7 +15,7 @@
my $self = shift;
outs("/base/list=$self");
for (0..1) {
- show('view');
+ show($self->base_path.'/view');
}
};
@@ -21,7 +23,7 @@
my $self = shift;
outs("/base/list=$self");
for (0..1) {
- render_region('view-'.$_, path => 'view');
+ render_region('view-'.$_, path => $self->base_path.'/view');
}
};
Modified: jifty/trunk/t/TestApp/lib/TestApp/View/instance.pm
==============================================================================
--- jifty/trunk/t/TestApp/lib/TestApp/View/instance.pm (original)
+++ jifty/trunk/t/TestApp/lib/TestApp/View/instance.pm Tue Jun 12 12:34:29 2007
@@ -2,6 +2,8 @@
use Jifty::View::Declare -base;
use base 'TestApp::View::base';
+sub base_path { '/instance' }
+
template 'myview' => sub {
};
Modified: jifty/trunk/t/TestApp/t/15-template-subclass.t
==============================================================================
--- jifty/trunk/t/TestApp/t/15-template-subclass.t (original)
+++ jifty/trunk/t/TestApp/t/15-template-subclass.t Tue Jun 12 12:34:29 2007
@@ -72,14 +72,8 @@
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}'" );
- TODO: {
-
- local $TODO = " Template subclassing needs some love";
- ok($mech->content =~ qr{$test->{text}}, "found the test content");
- # $mech->content_contains breaks on multiline content
- #$mech->content_contains( $test->{text}, "found content '$test->{text}'" );
- };
+ $mech->content_contains( $test->{text}, "found content '$test->{text}'" );
}
1;
More information about the Jifty-commit
mailing list