aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorlouise <louise>2009-09-23 17:01:00 +0000
committerlouise <louise>2009-09-23 17:01:00 +0000
commitc2c5be29c47584ea0aff8934ee7a796f30bb35b2 (patch)
tree07ba92d114f17d5b53bbedad65bd13d352b63e82 /t
parenta6e0574642c9b6aa0f4d3c43bba1f12b56bfdfa5 (diff)
Delegate setting of site title to cobrands
Diffstat (limited to 't')
-rwxr-xr-xt/Cobrand.t21
-rw-r--r--t/Cobrands/Mysite/Util.pm7
2 files changed, 24 insertions, 4 deletions
diff --git a/t/Cobrand.t b/t/Cobrand.t
index 8a5c69c95..f0f1751a0 100755
--- a/t/Cobrand.t
+++ b/t/Cobrand.t
@@ -6,12 +6,12 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Cobrand.t,v 1.12 2009-09-23 15:43:54 louise Exp $
+# $Id: Cobrand.t,v 1.13 2009-09-23 17:01:00 louise Exp $
#
use strict;
use warnings;
-use Test::More tests => 38;
+use Test::More tests => 41;
use Test::Exception;
use FindBin;
@@ -171,12 +171,25 @@ sub test_root_path_js {
# 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
+ # should return a js string setting the root path to an empty string otherwise
$cobrand = 'nosite';
$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');
}
+sub test_site_title {
+ my $cobrand = 'mysite';
+ my $site_title = Cobrand::site_title($cobrand);
+
+ # should get the results of the site_title function in the cobrand module if one exists
+ is($site_title, 'Mysite Title', 'site_title returns output from cobrand module');
+
+ # should return an empty string otherwise
+ $cobrand = 'nosite';
+ $site_title = Cobrand::site_title($cobrand);
+ is($site_title, '', 'site_title returns an empty string if no site title');
+}
+
ok(test_cobrand_handle() == 1, 'Ran all tests for the cobrand_handle function');
ok(test_cobrand_page() == 1, 'Ran all tests for the cobrand_page function');
ok(test_site_restriction() == 1, 'Ran all tests for the site_restriction function');
@@ -189,3 +202,5 @@ 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_js() == 1, 'Ran all tests for root_js');
+ok(test_site_title() == 1, 'Ran all tests for site_title');
+
diff --git a/t/Cobrands/Mysite/Util.pm b/t/Cobrands/Mysite/Util.pm
index 9cac84ca8..370e9d700 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.11 2009-09-23 15:43:54 louise Exp $
+# $Id: Util.pm,v 1.12 2009-09-23 17:01:00 louise Exp $
package Cobrands::Mysite::Util;
use Page;
@@ -70,4 +70,9 @@ sub header_params {
sub root_path_js {
return 'root path js';
}
+
+sub site_title {
+ return 'Mysite Title';
+}
+
1;