aboutsummaryrefslogtreecommitdiffstats
path: root/t/Page.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-07 18:01:18 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-07 18:01:18 +0100
commitdb5da038ea3a3264b4bae2490dbd877cba2ecab0 (patch)
tree561f6d2ea01ba93f968d5124a2f95714376fb194 /t/Page.t
parent673a2879a74d0d71c4d3be0b9c7ee567cf72b219 (diff)
parentf128b19cf7bf0da5dd445dc39d1a09e8953fc32d (diff)
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 't/Page.t')
-rwxr-xr-xt/Page.t55
1 files changed, 0 insertions, 55 deletions
diff --git a/t/Page.t b/t/Page.t
deleted file mode 100755
index 9331d4ef9..000000000
--- a/t/Page.t
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Page.t:
-# Tests for the Page functions
-#
-# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
-# Email: louise@mysociety.org; WWW: http://www.mysociety.org/
-#
-# $Id: Page.t,v 1.12 2009-12-09 13:34:36 louise Exp $
-#
-
-use strict;
-use warnings;
-use Test::More tests => 4;
-use Test::Exception;
-
-use FindBin;
-use lib "$FindBin::Bin";
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
-use Page;
-use FixMyStreet::Geocode;
-use mySociety::MockQuery;
-use mySociety::Locale;
-
-sub mock_query(){
- my $q = new MockQuery('mysite');
- return $q;
-}
-
-sub set_lang($) {
- my $lang = shift;
- mySociety::Locale::negotiate_language($lang);
- mySociety::Locale::gettext_domain('FixMyStreet');
- mySociety::Locale::change();
-}
-
-sub test_base_url_with_lang {
- set_lang('en-gb,English,en_GB');
- my $q = mock_query();
- my $url = Page::base_url_with_lang($q);
- ok($url eq 'http://mysite.example.com', 'Basic url rendered ok');
-
- $q = new MockQuery('emptyhomes');
- $url = Page::base_url_with_lang($q);
- like($url, qr/http:\/\/en\.emptyhomes\./, 'Empty homes url with lang returned ok');
-
- $url = Page::base_url_with_lang($q, 1);
- like($url, qr/http:\/\/cy\.emptyhomes\./, 'Empty homes url with lang reversed returned ok');
-
-}
-
-
-ok(test_base_url_with_lang() == 1, 'Ran all tests for base_url_with_lang');