aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/t/Cobrand.t
diff options
context:
space:
mode:
authorlouise <louise>2009-08-26 17:24:39 +0000
committerlouise <louise>2009-08-26 17:24:39 +0000
commit47be3af4139fb43150201f145d73d057589746e5 (patch)
tree0aa83aa0b45149b2b8de0416e978c02d4f2402ff /perllib/t/Cobrand.t
parent9f5f37ea2a64907b3695051191d1c5636980a958 (diff)
Adding a cobrand param to the querystring has no effect if there is no cobrand in the domain or there is no perl module for the cobrand
Diffstat (limited to 'perllib/t/Cobrand.t')
-rwxr-xr-xperllib/t/Cobrand.t11
1 files changed, 9 insertions, 2 deletions
diff --git a/perllib/t/Cobrand.t b/perllib/t/Cobrand.t
index 36ec9fefa..c9ad93b65 100755
--- a/perllib/t/Cobrand.t
+++ b/perllib/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.1 2009-08-26 16:52:14 louise Exp $
+# $Id: Cobrand.t,v 1.2 2009-08-26 17:24:40 louise Exp $
#
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More tests => 3;
use Test::Exception;
use FindBin;
@@ -24,9 +24,16 @@ use MockQuery;
sub test_cobrand_page{
my $q = new MockQuery('mysite');
+ # should get the result of the page function in the cobrand module if one exists
my ($html, $params) = Cobrand::cobrand_page($q);
like($html, qr/A cobrand produced page/, 'cobrand_page returns output from cobrand module');
+
+ # should return 0 if no cobrand module exists
+ $q = new MockQuery('mynonexistingsite');
+ ($html, $params) = Cobrand::cobrand_page($q);
+ is($html, 0, 'cobrand_page returns 0 if there is no cobrand module');
return 1;
+
}