diff options
author | louise <louise> | 2009-09-10 08:54:33 +0000 |
---|---|---|
committer | louise <louise> | 2009-09-10 08:54:33 +0000 |
commit | cdaae9dbf5631ee7c8bf6822fcc0ced0b91de8a6 (patch) | |
tree | 63774a50fbbf7c163e351377b1a54db3a7916e80 /t/Page.t | |
parent | d020b599a3e8be4d9455e8dd5981132b04b2b20c (diff) |
Delegate to cobrand for base_url in base_url_with_lang, delegate to cobrand for contact_email
Diffstat (limited to 't/Page.t')
-rwxr-xr-x | t/Page.t | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -6,12 +6,12 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: louise@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Page.t,v 1.2 2009-09-03 13:54:13 louise Exp $ +# $Id: Page.t,v 1.3 2009-09-10 08:54:33 louise Exp $ # use strict; use warnings; -use Test::More tests => 9; +use Test::More tests => 8; use Test::Exception; use FindBin; @@ -60,23 +60,18 @@ sub test_footer(){ } sub test_base_url_with_lang { - $ENV{HTTP_HOST}='test.com'; set_lang('en-gb,English,en_GB'); my $q = mock_query(); my $url = Page::base_url_with_lang($q); - ok($url eq 'http://test.com', 'Basic url rendered ok'); + ok($url eq 'http://mysite.example.com', 'Basic url rendered ok'); $q = new MockQuery('emptyhomes'); $url = Page::base_url_with_lang($q); - ok($url eq 'http://en.test.com', 'Empty homes url with lang returned ok'); + like($url, qr/http:\/\/en\.emptyhomes\./, 'Empty homes url with lang returned ok'); $url = Page::base_url_with_lang($q, 1); - ok($url eq 'http://cy.test.com', 'Empty homes url with lang reversed returned ok'); + like($url, qr/http:\/\/cy\.emptyhomes\./, 'Empty homes url with lang reversed returned ok'); - $q = new MockQuery('emptyhomes'); - $ENV{HTTP_HOST}='en.test.com'; - $url = Page::base_url_with_lang($q); - ok($url eq 'http://en.test.com', 'No extra lang part for emptyhomes url with lang part'); } ok(test_base_url_with_lang() == 1, 'Ran all tests for base_url_with_lang'); |