[Rt-commit] rt branch, 4.0/ie7js-cleanup, updated. rt-4.0.0-184-g06adf73

Thomas Sibley trs at bestpractical.com
Fri May 6 17:08:37 EDT 2011


The branch, 4.0/ie7js-cleanup has been updated
       via  06adf733081dae1e2a851ff1d666aea4225aab58 (commit)
       via  b0796223b7a74f87bf67960d6ba11d838b0b36c1 (commit)
      from  43597899182112e3e0bb813ba287a10d1b7a2bcb (commit)

Summary of changes:
 t/web/html/NoAuth/js/not-by-default.js |    3 +++
 t/web/squish.t                         |   18 +++++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)
 create mode 100644 t/web/html/NoAuth/js/not-by-default.js

- Log -----------------------------------------------------------------
commit b0796223b7a74f87bf67960d6ba11d838b0b36c1
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri May 6 17:05:59 2011 -0400

    Test using a test-specific extra JS file so we can keep the default @JSFiles

diff --git a/t/web/html/NoAuth/js/not-by-default.js b/t/web/html/NoAuth/js/not-by-default.js
new file mode 100644
index 0000000..568f670
--- /dev/null
+++ b/t/web/html/NoAuth/js/not-by-default.js
@@ -0,0 +1,3 @@
+function just_testing() {
+    alert("hi");
+}
diff --git a/t/web/squish.t b/t/web/squish.t
index 32d94ec..dd61f0b 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -5,7 +5,8 @@ use RT::Test tests => 18;
 
 RT->Config->Set( DevelMode            => 0 );
 RT->Config->Set( WebDefaultStylesheet => 'aileron' );
-RT->Config->Set( JSFiles => () );
+
+$RT::MasonLocalComponentRoot = RT::Test::get_abs_relocatable_dir('html');
 
 my ( $url, $m );
 
@@ -24,7 +25,7 @@ diag "test squished files with devel mode disabled";
     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('function showShredderPluginTab', "no util.js");
+    $m->content_lacks('function just_testing', "no not-by-default.js");
 
     RT::Test->stop_server;
 }
@@ -34,7 +35,7 @@ SKIP:
 {
     skip 'need plack server to reinitialize', 6
       if $ENV{RT_TEST_WEB_HANDLER} && $ENV{RT_TEST_WEB_HANDLER} ne 'plack';
-    RT->AddJavaScript( 'util.js' );
+    RT->AddJavaScript( 'not-by-default.js' );
     RT->AddStyleSheets( 'print.css' );
     ( $url, $m ) = RT::Test->started_ok;
 
@@ -49,20 +50,20 @@ SKIP:
     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('function showShredderPluginTab', "has util.js");
+    $m->content_contains('function just_testing', "has not-by-default.js");
     RT::Test->stop_server;
 }
 
 diag "test squished files with devel mode enabled";
 {
     RT->Config->Set( 'DevelMode' => 1 );
-    RT->AddJavaScript( 'util.js' );
+    RT->AddJavaScript( 'not-by-default.js' );
     RT->AddStyleSheets( 'nottherebutwedontcare.css' );
 
     ( $url, $m ) = RT::Test->started_ok;
     $m->login;
     $m->content_unlike( qr!squished-.*?\.(js|css)!,
         'no squished link with develmode' );
-    $m->content_contains('util.js', "found extra javascript resource");
+    $m->content_contains('not-by-default.js', "found extra javascript resource");
     $m->content_contains('nottherebutwedontcare.css', "found extra css resource");
 }

commit 06adf733081dae1e2a851ff1d666aea4225aab58
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri May 6 17:07:59 2011 -0400

    Test some of our default JS content as well

diff --git a/t/web/squish.t b/t/web/squish.t
index dd61f0b..2ee6153 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 18;
+use RT::Test tests => 21;
 
 RT->Config->Set( DevelMode            => 0 );
 RT->Config->Set( WebDefaultStylesheet => 'aileron' );
@@ -26,6 +26,7 @@ diag "test squished files with devel mode disabled";
       $m->content =~ m!src="([^"]+?squished-([a-f0-9]{32})\.js)"!;
     $m->get_ok( $url . $js_link, 'follow squished js' );
     $m->content_lacks('function just_testing', "no not-by-default.js");
+    $m->content_contains('jQuery.noConflict', "found default js content");
 
     RT::Test->stop_server;
 }
@@ -51,6 +52,7 @@ SKIP:
       $m->content =~ m!src="([^"]+?squished-([a-f0-9]{32})\.js)"!;
     $m->get_ok( $url . $js_link, 'follow squished js' );
     $m->content_contains('function just_testing', "has not-by-default.js");
+    $m->content_contains('jQuery.noConflict', "found default js content");
     RT::Test->stop_server;
 }
 
@@ -66,4 +68,5 @@ diag "test squished files with devel mode enabled";
         'no squished link with develmode' );
     $m->content_contains('not-by-default.js', "found extra javascript resource");
     $m->content_contains('nottherebutwedontcare.css', "found extra css resource");
+    $m->content_contains('jquery_noconflict.js', "found a default js resource");
 }

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


More information about the Rt-commit mailing list