aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorlouise <louise>2009-09-23 15:43:54 +0000
committerlouise <louise>2009-09-23 15:43:54 +0000
commita6e0574642c9b6aa0f4d3c43bba1f12b56bfdfa5 (patch)
tree032ff18eb49bd79884d559908d477726647bf545 /t
parent1ed78ecb294d558b91739170c8e78bd3db8360ba (diff)
Ugly way of allowing the AJAX paths to change depending on what root path the pages are being served from
Diffstat (limited to 't')
-rwxr-xr-xt/Cobrand.t16
-rw-r--r--t/Cobrands/Mysite/Util.pm6
2 files changed, 11 insertions, 11 deletions
diff --git a/t/Cobrand.t b/t/Cobrand.t
index 28dbeaf6b..8a5c69c95 100755
--- a/t/Cobrand.t
+++ b/t/Cobrand.t
@@ -6,7 +6,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Cobrand.t,v 1.11 2009-09-23 11:31:32 louise Exp $
+# $Id: Cobrand.t,v 1.12 2009-09-23 15:43:54 louise Exp $
#
use strict;
@@ -164,17 +164,17 @@ sub test_header_params {
is_deeply($header_params, {}, 'header_params returns an empty hash ref if no cobrand module');
}
-sub test_root_path_pattern {
+sub test_root_path_js {
my $cobrand = 'mysite';
- my $root_path_pattern = Cobrand::root_path_pattern($cobrand);
+ my $root_path_js = Cobrand::root_path_js($cobrand);
- # should get the results of the root_path_pattern function in the cobrand module if one exists
- is($root_path_pattern, 'root path pattern', 'root_path_pattern returns output from cobrand module');
+ # should get the results of the root_path_js function in the cobrand module if one exists
+ is($root_path_js, 'root path js', 'root_path_js returns output from cobrand module');
# should return an empty regex string otherwise
$cobrand = 'nosite';
- $root_path_pattern = Cobrand::root_path_pattern($cobrand);
- is($root_path_pattern, '//g', 'root_path_pattern returns an empty regex string if no cobrand module');
+ $root_path_js = Cobrand::root_path_js($cobrand);
+ is($root_path_js, 'var root_path = "";', 'root_path_pattern returns a string setting the root path to an empty string if no cobrand module');
}
ok(test_cobrand_handle() == 1, 'Ran all tests for the cobrand_handle function');
@@ -188,4 +188,4 @@ ok(test_extra_problem_data() == 1, 'Ran all tests for extra_problem_data');
ok(test_extra_update_data() == 1, 'Ran all tests for extra_update_data');
ok(test_extra_params() == 1, 'Ran all tests for extra_params');
ok(test_header_params() == 1, 'Ran all tests for header_params');
-ok(test_root_path_pattern() == 1, 'Ran all tests for root_path_pattern');
+ok(test_root_path_js() == 1, 'Ran all tests for root_js');
diff --git a/t/Cobrands/Mysite/Util.pm b/t/Cobrands/Mysite/Util.pm
index 9ddd4c01e..9cac84ca8 100644
--- a/t/Cobrands/Mysite/Util.pm
+++ b/t/Cobrands/Mysite/Util.pm
@@ -7,7 +7,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: Util.pm,v 1.10 2009-09-23 11:31:32 louise Exp $
+# $Id: Util.pm,v 1.11 2009-09-23 15:43:54 louise Exp $
package Cobrands::Mysite::Util;
use Page;
@@ -67,7 +67,7 @@ sub header_params {
}
-sub root_path_pattern {
- return 'root path pattern';
+sub root_path_js {
+ return 'root path js';
}
1;