[Jifty-commit] r7654 - in jifty/trunk/t/TestApp: lib/TestApp t
Jifty commits
jifty-commit at lists.jifty.org
Thu Nov 19 12:24:36 EST 2009
Author: jesse
Date: Thu Nov 19 12:24:35 2009
New Revision: 7654
Added:
jifty/trunk/t/TestApp/share/web/templates/sample-widget
jifty/trunk/t/TestApp/t/css_content_type.t
Modified:
jifty/trunk/t/TestApp/lib/TestApp/Dispatcher.pm
Log:
Create a failing test for our content-type bleedthrough
Modified: jifty/trunk/t/TestApp/lib/TestApp/Dispatcher.pm
==============================================================================
--- jifty/trunk/t/TestApp/lib/TestApp/Dispatcher.pm (original)
+++ jifty/trunk/t/TestApp/lib/TestApp/Dispatcher.pm Thu Nov 19 12:24:35 2009
@@ -105,4 +105,16 @@
set footer => 'normal';
};
+
+
+before '*' => run {
+
+ Jifty->web->navigation->child( test1 => label => '<i>Italic</i>', escape_label => 0);
+
+ my $content = Jifty->web->render_template('/sample-widget');
+ Jifty->web->navigation->child( test2 => label => $content, escape_label => 0);
+};
+
+
+
1;
Added: jifty/trunk/t/TestApp/share/web/templates/sample-widget
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/share/web/templates/sample-widget Thu Nov 19 12:24:35 2009
@@ -0,0 +1,3 @@
+<form id="inmenu" name="inmenu">
+<input type="text" name="x" id="x"/>
+</form>
Added: jifty/trunk/t/TestApp/t/css_content_type.t
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/t/css_content_type.t Thu Nov 19 12:24:35 2009
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+
+use Jifty::Test::Dist tests => 6;
+use Jifty::Test::WWW::Mechanize;
+
+my $server = Jifty::Test->make_server;
+my $url = $server->started_ok;
+
+my $mech = Jifty::Test::WWW::Mechanize->new;
+$mech->get_ok( $url, 'grab a page' );
+
+my $css_page = '';
+if ( $mech->content =~ qr{type="text/css" href="(.*?)"} ) {
+ $css_page = $1;
+}
+
+
+$mech->content_like(qr'<form id="inmenu"');
+
+ok($css_page, "Got a link to the CSS page");
+$mech->get_ok($url.$css_page, "Got the CSS");
+is($mech->content_type, 'text/css', "the css file is served out with the right content type");
+
More information about the Jifty-commit
mailing list