[Rt-commit] rt branch, squish-refactor, updated. rt-3.9.7-880-g6b4c829

? sunnavy sunnavy at bestpractical.com
Wed Dec 15 05:51:19 EST 2010


The branch, squish-refactor has been updated
       via  6b4c829326478ab68bb88947ee6cae500ece0195 (commit)
       via  8733496aafba1f34ea7fc03773a4836a1f1206f4 (commit)
      from  42c57da1c3e5301bddbcd5232b5cb5991e2f83dd (commit)

Summary of changes:
 lib/RT/Squish/CSS.pm |    1 -
 t/web/squish.t       |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletions(-)
 create mode 100644 t/web/squish.t

- Log -----------------------------------------------------------------
commit 8733496aafba1f34ea7fc03773a4836a1f1206f4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 15 18:50:11 2010 +0800

    tiny old code clean

diff --git a/lib/RT/Squish/CSS.pm b/lib/RT/Squish/CSS.pm
index a405bb9..e559f22 100644
--- a/lib/RT/Squish/CSS.pm
+++ b/lib/RT/Squish/CSS.pm
@@ -66,7 +66,6 @@ use warnings;
 
 package RT::Squish::CSS;
 use base 'RT::Squish', 'CSS::Squish';
-__PACKAGE__->mk_accessors('style');
 use List::MoreUtils 'uniq';
 
 =head2 SquishFiles

commit 6b4c829326478ab68bb88947ee6cae500ece0195
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 15 18:50:46 2010 +0800

    real squish test

diff --git a/t/web/squish.t b/t/web/squish.t
new file mode 100644
index 0000000..7a144c8
--- /dev/null
+++ b/t/web/squish.t
@@ -0,0 +1,60 @@
+use strict;
+use warnings;
+use RT;
+use RT::Test tests => 16;
+
+RT->Config->Set( DevelMode            => 0 );
+RT->Config->Set( WebDefaultStylesheet => 'aileron' );
+
+my ( $url, $m );
+
+diag "test squished files with devel mode disabled";
+{
+    ( $url, $m ) = RT::Test->started_ok;
+    $m->login;
+
+    $m->follow_link_ok( { url_regex => qr!main-squished-([a-f0-9]{32})\.css! },
+        'follow squished css' );
+    $m->content_like( qr!/\*\* End of .*?.css \*/!, 'squished css' );
+    $m->content_lacks( 'print.css', 'no print.css by default' );
+
+    $m->back;
+    my ($js_link) =
+      $m->content =~ m!src="([^"]+squished-([^"]+)-([a-f0-9]{32})\.js)"!;
+    $m->get_ok( $url . $js_link, 'follow squished js' );
+    $m->content_lacks( 'IE7=', 'no IE7.js by default' );
+
+    RT::Test->stop_server;
+}
+
+diag "test squished files with customized files and devel mode disabled";
+{
+    require RT::Squish::JS;
+    RT::Squish::JS->UpdateFilesMap( head => ['/NoAuth/js/IE7/IE7.js'] );
+    require RT::Squish::CSS;
+    RT::Squish::CSS->UpdateFilesMap( aileron => ['/NoAuth/css/print.css'] );
+    ( $url, $m ) = RT::Test->started_ok;
+
+    $m->login;
+    $m->follow_link_ok( { url_regex => qr!main-squished-([a-f0-9]{32})\.css! },
+        'follow squished css' );
+    $m->content_like( qr!/\*\* End of .*?.css \*/!, 'squished css' );
+    $m->content_contains( 'text-decoration: underline !important;',
+        'has print.css' );
+
+    $m->back;
+    my ($js_link) =
+      $m->content =~ m!src="([^"]+squished-([^"]+)-([a-f0-9]{32})\.js)"!;
+    $m->get_ok( $url . $js_link, 'follow squished js' );
+    $m->content_contains( 'IE7=', 'has IE7.js' );
+    RT::Test->stop_server;
+}
+
+diag "test squished files with devel mode enabled";
+{
+    RT->Config->Set( 'DevelMode' => 1 );
+    ( $url, $m ) = RT::Test->started_ok;
+    $m->login;
+    $m->content_unlike( qr!squished-.*?\.(js|css)!,
+        'no squished link with develmode' );
+}

-----------------------------------------------------------------------


More information about the Rt-commit mailing list