aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/about.t12
-rw-r--r--t/i18n.t9
2 files changed, 15 insertions, 6 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t
index adbce8f25..aeca47d86 100644
--- a/t/app/controller/about.t
+++ b/t/app/controller/about.t
@@ -8,17 +8,19 @@ ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
# check that we can get the page
$mech->get_ok('/about');
-$mech->content_contains('FixMyStreet.com');
+$mech->content_contains('About Us :: FixMyStreet.com');
+$mech->content_contains('html lang="en-gb"');
# check that geting the page as EHA produces a different page
ok $mech->host("reportemptyhomes.co.uk"), 'change host to reportemptyhomes';
$mech->get_ok('/about');
-$mech->content_contains('The Empty Homes Agency');
+$mech->content_contains('About us :: Report Empty Homes');
+$mech->content_contains('html lang="en-gb"');
# check that geting the page as EHA in welsh produces a different page
-ok $mech->host("cy.reportemptyhomes.co.uk"),
- 'change host to cy.reportemptyhomes';
+ok $mech->host("cy.reportemptyhomes.co.uk"), 'host to cy.reportemptyhomes';
$mech->get_ok('/about');
-$mech->content_contains('Yr Asiantaeth Tai Gwag');
+$mech->content_contains('Amdanom ni :: Adrodd am Eiddo Gwag');
+$mech->content_contains('html lang="cy"');
done_testing();
diff --git a/t/i18n.t b/t/i18n.t
index e11589d8b..6a5d94fa2 100644
--- a/t/i18n.t
+++ b/t/i18n.t
@@ -10,7 +10,7 @@ use mySociety::Locale;
die "You need to run 'commonlib/bin/gettext-makemo --quiet FixMyStreet' "
. "to generate the *.mo files needed."
unless -e FixMyStreet->path_to(
- 'locale/cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.mo');
+ 'locale/cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.mo');
# Example strings
my $english = "Sorry! Something's gone wrong.";
@@ -29,4 +29,11 @@ is _($english), $english, "english to english";
mySociety::Locale::change('cy');
is _($english), $welsh, "english to welsh";
+# check that being in a deep directory does not confuse the code
+chdir FixMyStreet->path_to('t/app/controller') . '';
+mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', 1,
+ FixMyStreet->path_to('locale')->stringify );
+mySociety::Locale::change('cy');
+is _($english), $welsh, "english to welsh (deep directory)";
+
done_testing();