[Rt-commit] rt branch, 4.0/sanity-check-url-config, updated. rt-3.9.7-1133-gc66f033

Shawn Moore sartak at bestpractical.com
Tue Dec 28 20:23:01 EST 2010


The branch, 4.0/sanity-check-url-config has been updated
       via  c66f03325bb1c47f7734174abeb6458bb2031acf (commit)
      from  01c6628f00a57cc6c0176e5268e92200f4a74841 (commit)

Summary of changes:
 t/api/web-config.t |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit c66f03325bb1c47f7734174abeb6458bb2031acf
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Dec 28 20:22:43 2010 -0500

    More extensive nested-directory path testing

diff --git a/t/api/web-config.t b/t/api/web-config.t
index d18d49e..fb986f1 100644
--- a/t/api/web-config.t
+++ b/t/api/web-config.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test nodb => 1, tests => 49;
+use RT::Test nodb => 1, tests => 64;
 
 sub warnings_from {
     my $option = shift;
@@ -21,6 +21,7 @@ sub warnings_from {
 # WebPath
 is(warnings_from(WebPath => ''), 0);
 is(warnings_from(WebPath => '/foo'), 0);
+is(warnings_from(WebPath => '/foo/bar'), 0);
 
 my @w = warnings_from(WebPath => '/foo/');
 is(@w, 1);
@@ -35,6 +36,19 @@ is(@w, 2);
 like($w[0], qr/The WebPath config option requires no trailing slash/);
 like($w[1], qr/The WebPath config option requires a leading slash/);
 
+ at w = warnings_from(WebPath => '/foo/bar/');
+is(@w, 1);
+like($w[0], qr/The WebPath config option requires no trailing slash/);
+
+ at w = warnings_from(WebPath => 'foo/bar');
+is(@w, 1);
+like($w[0], qr/The WebPath config option requires a leading slash/);
+
+ at w = warnings_from(WebPath => 'foo/bar/');
+is(@w, 2);
+like($w[0], qr/The WebPath config option requires no trailing slash/);
+like($w[1], qr/The WebPath config option requires a leading slash/);
+
 @w = warnings_from(WebPath => '/');
 is(@w, 1);
 like($w[0], qr{For the WebPath config option, use the empty string instead of /});
@@ -63,6 +77,10 @@ like($w[0], qr{The WebDomain config option must not contain a scheme \(https://\
 is(@w, 1);
 like($w[0], qr{The WebDomain config option must not contain a path \(/path\)});
 
+ at w = warnings_from(WebDomain => 'rt.example.com/path/more');
+is(@w, 1);
+like($w[0], qr{The WebDomain config option must not contain a path \(/path/more\)});
+
 # reinstate a valid WebDomain for other tests
 is(warnings_from(WebDomain => 'rt.example.com'), 0);
 
@@ -103,6 +121,15 @@ like($w[0], qr{The WebBaseURL config option must contain a scheme});
 is(@w, 1);
 like($w[0], qr{The WebBaseURL config option requires no trailing slash});
 
+ at w = warnings_from(WebBaseURL => 'http://rt.example.com/rt');
+is(@w, 1);
+like($w[0], qr{The WebBaseURL config option must not contain a path \(/rt\)});
+
+ at w = warnings_from(WebBaseURL => 'http://rt.example.com/rt/');
+is(@w, 2);
+like($w[0], qr{The WebBaseURL config option requires no trailing slash});
+like($w[1], qr{The WebBaseURL config option must not contain a path \(/rt/\)});
+
 @w = warnings_from(WebBaseURL => 'http://rt.example.com/rt/ir');
 is(@w, 1);
 like($w[0], qr{The WebBaseURL config option must not contain a path \(/rt/ir\)});

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


More information about the Rt-commit mailing list