diff options
author | Dave Arter <davea@mysociety.org> | 2019-05-22 17:45:58 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-28 15:12:59 +0100 |
commit | 323d3a632453bfcd10360fe2c2b9e4d684f350c8 (patch) | |
tree | dd067f8ca335231f2d281d8e1dc23307aa749ca6 /t/app | |
parent | 418ed096e7c79c8ccde9a2eb5023a7a4f0210402 (diff) |
Switch all Norwegian tests to Swedish.
On Macs, the Norwegian locale is no_NO, whereas on Debian it is nb_NO:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=206474
This can cause issues running the Norwegian tests on Macs with certain
setups (e.g. on my machine a Homebrew installation of perl and gettext
fails, but MacPorts and system pass). As Swedish is sv_SE in both, the
easiest solution is to switch the tests to Swedish.
Diffstat (limited to 't/app')
-rw-r--r-- | t/app/01app.t | 7 | ||||
-rw-r--r-- | t/app/controller/about.t | 8 | ||||
-rw-r--r-- | t/app/model/alert_type.t | 8 | ||||
-rw-r--r-- | t/app/model/state.t | 8 |
4 files changed, 14 insertions, 17 deletions
diff --git a/t/app/01app.t b/t/app/01app.t index df562b829..596e0de47 100644 --- a/t/app/01app.t +++ b/t/app/01app.t @@ -4,7 +4,7 @@ use strict; use warnings; package FixMyStreet::Cobrand::Tester; -use parent 'FixMyStreet::Cobrand::FiksGataMi'; +use parent 'FixMyStreet::Cobrand::FixaMinGata'; sub front_stats_data { { new => 0, fixed => 0, updates => 12345 } } package main; @@ -12,7 +12,6 @@ package main; use Test::More; use Catalyst::Test 'FixMyStreet::App'; use charnames ':full'; -use Encode qw(encode); ok( request('/')->is_success, 'Request should succeed' ); @@ -20,10 +19,8 @@ SKIP: { FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'tester' ], }, sub { - skip 'Test will not pass on Mac OS', 1 if $^O eq 'darwin'; - my $page = get('/'); - my $num = encode('UTF-8', "12\N{NO-BREAK SPACE}345"); + my $num = "12 345"; like $page, qr/$num/; }; } diff --git a/t/app/controller/about.t b/t/app/controller/about.t index 43ee642e4..e1ffc34bb 100644 --- a/t/app/controller/about.t +++ b/t/app/controller/about.t @@ -24,12 +24,12 @@ ok !$mech->res->is_success(), "want a bad response"; is $mech->res->code, 404, "got 404"; FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'fiksgatami' ], + ALLOWED_COBRANDS => [ 'fixamingata' ], }, sub { - ok $mech->host("www.fiksgatami.no"), 'host to fiksgatami'; + ok $mech->host("www.fixamingata.se"), 'host to fixamingata'; $mech->get_ok('/faq'); - $mech->content_like(qr{Ofte spurte spørsmål ::}); - $mech->content_contains('html class="no-js" lang="nb"'); + $mech->content_like(qr{Vanliga frågor ::}); + $mech->content_contains('html class="no-js" lang="sv"'); }; $mech->get_ok('/'); diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t index 78574ac36..ecca2df3d 100644 --- a/t/app/model/alert_type.t +++ b/t/app/model/alert_type.t @@ -486,7 +486,7 @@ subtest "correct i18n-ed summary for state of closed" => sub { $mech->clear_emails_ok; $report->update( { state => 'closed' } ); - $alert->update( { lang => 'nb', cobrand => 'fiksgatami' } ); + $alert->update( { lang => 'sv', cobrand => 'fixamingata' } ); FixMyStreet::DB->resultset('AlertSent')->search( { alert_id => $alert->id, @@ -494,14 +494,14 @@ subtest "correct i18n-ed summary for state of closed" => sub { } )->delete; FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'fiksgatami' ], + ALLOWED_COBRANDS => [ 'fixamingata' ], }, sub { FixMyStreet::DB->resultset('AlertType')->email_alerts(); }; my $body = $mech->get_text_body_from_email; - my $msg = 'Denne rapporten er for tiden markert som lukket'; - like $body, qr/$msg/, 'email says problem is closed, in Norwegian'; + my $msg = 'Den här rapporten är markerad som stängd'; + like $body, qr/$msg/, 'email says problem is closed, in Swedish'; }; END { diff --git a/t/app/model/state.t b/t/app/model/state.t index 35f3d4fb3..f680cf3e8 100644 --- a/t/app/model/state.t +++ b/t/app/model/state.t @@ -66,14 +66,14 @@ is_deeply [ sort FixMyStreet::DB::Result::Problem->fixed_states ], ['fixed', 'fixed - council', 'fixed - user'], 'fixed states okay'; FixMyStreet::override_config { - LANGUAGES => [ 'en-gb,English,en_GB', 'nb,Norwegian,nb_NO' ], + LANGUAGES => [ 'en-gb,English,en_GB', 'sv,Swedish,sv_SE' ], }, sub { subtest 'translation of open works both ways (file/db)' => sub { # Note at this point the states have been cached my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('default')->new; - my $lang = $cobrand->set_lang_and_domain('nb', 1, FixMyStreet->path_to('locale')->stringify); - is $lang, 'nb'; - is $rs->display('confirmed'), "Åpen"; + my $lang = $cobrand->set_lang_and_domain('sv', 1, FixMyStreet->path_to('locale')->stringify); + is $lang, 'sv'; + is $rs->display('confirmed'), "Öppen"; $lang = $cobrand->set_lang_and_domain('en-gb', 1, FixMyStreet->path_to('locale')->stringify); is $lang, 'en-gb'; is $rs->display('confirmed'), "Open Eng trans"; |