aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-04-22 13:49:47 +0100
committerMatthew Somerville <matthew@mysociety.org>2016-04-22 13:49:47 +0100
commitc923ee706a122863b2c9db94bf09dfe235b4fd4d (patch)
tree2e2fefa4684e3ecae329e0533e567fb6a09872f5 /t
parentc9d7be8f8994ca51685c71bd7490ef42822d41b3 (diff)
parent66eb844d7eaba7155e362dcec8a7a7db8f3dbf4c (diff)
Merge branch '1383-remove-dead-projects'
Diffstat (limited to 't')
-rw-r--r--t/app/controller/about.t18
-rw-r--r--t/app/controller/admin.t10
-rw-r--r--t/app/controller/questionnaire.t25
-rw-r--r--t/app/controller/report_interest_count.t24
-rw-r--r--t/app/controller/reports.t11
-rw-r--r--t/app/model/user.t2
-rw-r--r--t/app/uri_for.t26
-rw-r--r--t/cobrand/fixmybarangay.t150
-rw-r--r--t/cobrand/form_extras.t1
-rw-r--r--t/cobrand/loading.t30
-rw-r--r--t/i18n.t25
11 files changed, 60 insertions, 262 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t
index 6a082a2ff..cec50abfa 100644
--- a/t/app/controller/about.t
+++ b/t/app/controller/about.t
@@ -1,3 +1,4 @@
+use utf8;
use strict;
use warnings;
@@ -21,19 +22,12 @@ ok !$mech->res->is_success(), "want a bad response";
is $mech->res->code, 404, "got 404";
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes' ],
+ ALLOWED_COBRANDS => [ 'fiksgatami' ],
}, sub {
- # 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_like(qr{About us ::});
- $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"), 'host to cy.reportemptyhomes';
- $mech->get_ok('/about');
- $mech->content_like(qr{Amdanom ni ::});
- $mech->content_contains('html lang="cy"');
+ ok $mech->host("www.fiksgatami.no"), 'host to fiksgatami';
+ $mech->get_ok('/faq');
+ $mech->content_like(qr{Ofte spurte spørsmål ::});
+ $mech->content_contains('html class="no-js" lang="nb"');
};
done_testing();
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 310e0a677..1dcb768dc 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -104,9 +104,9 @@ subtest 'check summary counts' => sub {
$mech->content_contains( "$q_count questionnaires sent" );
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'barnet' ],
+ ALLOWED_COBRANDS => [ 'oxfordshire' ],
}, sub {
- ok $mech->host('barnet.fixmystreet.com');
+ ok $mech->host('oxfordshire.fixmystreet.com');
$mech->get_ok('/admin');
$mech->title_like(qr/Summary/);
@@ -115,11 +115,11 @@ subtest 'check summary counts' => sub {
my ($num_alerts) = $mech->content =~ /(\d+) confirmed alerts/;
my ($num_qs) = $mech->content =~ /(\d+) questionnaires sent/;
- $report->bodies_str(2489);
- $report->cobrand('barnet');
+ $report->bodies_str(2237);
+ $report->cobrand('oxfordshire');
$report->update;
- $alert->cobrand('barnet');
+ $alert->cobrand('oxfordshire');
$alert->update;
$mech->get_ok('/admin');
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t
index cad86a40d..7bc6545db 100644
--- a/t/app/controller/questionnaire.t
+++ b/t/app/controller/questionnaire.t
@@ -394,31 +394,23 @@ for my $test (
}
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'fixmystreet' ],
}, sub {
- # EHA extra checking
- ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes';
-
- # Reset, and all the questionaire sending function - FIXME should it detect site itself somehow?
+ $report->discard_changes;
$report->send_questionnaire( 1 );
$report->update;
$questionnaire->delete;
- FixMyStreet::App->model('DB::Questionnaire')->send_questionnaires( {
- site => 'emptyhomes'
- } );
+ FixMyStreet::App->model('DB::Questionnaire')->send_questionnaires();
$email = $mech->get_email;
ok $email, "got an email";
$mech->clear_emails_ok;
(my $body = $email->body) =~ s/\s+/ /g;
- like $body, qr/fill in this short questionnaire/i, "got questionnaire email";
+ like $body, qr/fill in our short questionnaire/i, "got questionnaire email";
($token) = $email->body =~ m{http://.*?/Q/(\S+)};
ok $token, "extracted questionnaire token '$token'";
- $mech->get_ok("/Q/" . $token);
- $mech->content_lacks( 'Would you like to receive another questionnaire' );
-
# Test already answered the ever reported question, so not shown again
$dt = $dt->add( weeks => 4 );
my $questionnaire2 = FixMyStreet::App->model('DB::Questionnaire')->find_or_create(
@@ -429,17 +421,11 @@ FixMyStreet::override_config {
}
);
ok $questionnaire2, 'added another questionnaire';
- ok $mech->host("www.fixmystreet.com"), 'change host to fixmystreet';
$mech->get_ok("/Q/" . $token);
$mech->title_like( qr/Questionnaire/ );
$mech->content_contains( 'Has this problem been fixed?' );
$mech->content_lacks( 'ever reported' );
- # EHA extra checking
- ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes';
- $mech->get_ok("/Q/" . $token);
- $mech->content_lacks( 'Would you like to receive another questionnaire' );
-
$token = FixMyStreet::App->model("DB::Token")->find( { scope => 'questionnaire', token => $token } );
ok $token, 'found token for questionnaire';
$questionnaire = FixMyStreet::App->model('DB::Questionnaire')->find( { id => $token->data } );
@@ -452,11 +438,12 @@ FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'fiksgatami' ],
}, sub {
# I18N Unicode extra testing using FiksGataMi
+ $report->discard_changes;
$report->send_questionnaire( 1 );
$report->cobrand( 'fiksgatami' );
$report->update;
$questionnaire->delete;
- FixMyStreet::App->model('DB::Questionnaire')->send_questionnaires( { site => 'fixmystreet' } ); # It's either fixmystreet or emptyhomes
+ FixMyStreet::App->model('DB::Questionnaire')->send_questionnaires();
$email = $mech->get_email;
ok $email, "got an email";
$mech->clear_emails_ok;
diff --git a/t/app/controller/report_interest_count.t b/t/app/controller/report_interest_count.t
index 506b50edd..4e86789ba 100644
--- a/t/app/controller/report_interest_count.t
+++ b/t/app/controller/report_interest_count.t
@@ -1,5 +1,16 @@
use strict;
use warnings;
+
+package FixMyStreet::Cobrand::Tester;
+
+use parent 'FixMyStreet::Cobrand::Default';
+
+sub can_support_problems {
+ return 1;
+}
+
+package main;
+
use Test::More;
use FixMyStreet::TestMech;
@@ -52,7 +63,7 @@ my $report_id = $report->id;
ok $report, "created test report - $report_id";
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'fixmybarangay' ],
+ ALLOWED_COBRANDS => [ 'tester' ],
}, sub {
my $body = $mech->create_body_ok(2504, 'Westminster City Council');
@@ -76,7 +87,6 @@ FixMyStreet::override_config {
},
) {
subtest $test->{desc} => sub {
- ok $mech->host('fixmybarangay.com'), 'changed to fixmybarangay';
$mech->log_in_ok( $user->email );
$user->from_body( $test->{from_body} );
$user->update;
@@ -92,7 +102,7 @@ FixMyStreet::override_config {
$mech->content_contains('Add support');
$mech->submit_form_ok( { form_number => 1 } );
- is $mech->uri, "http://fixmybarangay.com/report/$report_id", 'add support redirects to report page';
+ is $mech->uri->path, "/report/$report_id", 'add support redirects to report page';
$mech->content_contains($test->{updated_support});
} else {
@@ -102,26 +112,22 @@ FixMyStreet::override_config {
}
subtest 'check non body user cannot increment support count' => sub {
- ok $mech->host('fixmybarangay.com'), 'changed to fixmybarangay';
-
ok $report->update({ interest_count => 1 }), 'updated interest count';
is $report->interest_count, 1, 'correct interest count';
$mech->get_ok("/report/$report_id");
$mech->content_contains( '1 supporter' );
- # This doesn't send cookie, so is logged out
+ $mech->log_out_ok( $user->email );
$mech->post_ok("/report/support", { id => $report_id } );
- is $mech->uri, "http://fixmybarangay.com/report/$report_id", 'add support redirects to report page';
+ is $mech->uri->path, "/report/$report_id", 'add support redirects to report page';
$mech->content_contains( '1 supporter' );
};
};
subtest 'check support details not shown if not enabled in cobrand' => sub {
- ok $mech->host('www.fixmystreet.com'), 'changed to fixmystreet';
-
$report->interest_count(1);
ok $report->update, 'updated interest count';
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t
index 9b446174d..8869adaa7 100644
--- a/t/app/controller/reports.t
+++ b/t/app/controller/reports.t
@@ -196,17 +196,6 @@ $mech->get_ok('/reports');
$stats = $mech->extract_report_stats;
is $stats->{'Westminster City Council'}->[1], 5, 'non public reports included in stats';
-subtest "test emptyhomes all reports page" => sub {
- FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes' ],
- }, sub {
- ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes';
- $mech->get_ok('/reports');
- # EHA lacks one column the others have
- $mech->content_lacks('state unknown');
- };
-};
-
subtest "test fiksgatami all reports page" => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'fiksgatami' ],
diff --git a/t/app/model/user.t b/t/app/model/user.t
index 24e5d2d98..bf73a9d09 100644
--- a/t/app/model/user.t
+++ b/t/app/model/user.t
@@ -46,7 +46,7 @@ END {
sub create_update {
my ($problem, %params) = @_;
- my $dt = DateTime->now()->add(hours => 1);
+ my $dt = DateTime->now()->add(days => 1);
return FixMyStreet::App->model('DB::Comment')->find_or_create({
problem_id => $problem->id,
user_id => $problem->user_id,
diff --git a/t/app/uri_for.t b/t/app/uri_for.t
index 810aade62..9cbcd3767 100644
--- a/t/app/uri_for.t
+++ b/t/app/uri_for.t
@@ -17,7 +17,6 @@ use_ok('FixMyStreet::App');
my $fms_c = ctx_request('http://www.fixmystreet.com/');
my $fgm_c = ctx_request('http://www.fiksgatami.no/');
-my $reh_en_c = ctx_request('http://reportemptyhomes.com/');
is(
$fms_c->uri_for('/bar/baz') . "",
@@ -44,29 +43,4 @@ is(
'FiksGataMi url with lat not zoom'
);
-FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes' ],
-}, sub {
- like(
- $reh_en_c->uri_for_email( '/foo' ),
- qr{^http://en.},
- 'adds en to retain language'
- );
-};
-
-# instantiate this here otherwise sets locale to cy and breaks test
-# above
-my $reh_cy_c;
-FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes' ],
-}, sub {
- $reh_cy_c = ctx_request('http://cy.reportemptyhomes.com/');
-
- like(
- $reh_cy_c->uri_for_email( '/foo' ),
- qr{^http://cy.},
- 'retains language'
- );
-};
-
done_testing();
diff --git a/t/cobrand/fixmybarangay.t b/t/cobrand/fixmybarangay.t
deleted file mode 100644
index 2f99b8c1e..000000000
--- a/t/cobrand/fixmybarangay.t
+++ /dev/null
@@ -1,150 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-BEGIN {
- use FixMyStreet;
- FixMyStreet->test_mode(1);
-}
-
-use FixMyStreet::TestMech;
-my $mech = FixMyStreet::TestMech->new;
-
-# Front page test
-
-ok $mech->host("www.fixmybarangay.com"), "change host to FixMyBarangay";
-FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'fixmybarangay' ],
-}, sub {
- $mech->get_ok('/');
-};
-$mech->content_like( qr/FixMyBarangay/ );
-
-# Set up bodies
-
-my $luz = $mech->create_body_ok( 1, 'Bgy Luz', id => 1 );
-$luz->update( { send_method => 'Email' } );
-
-my $bsn = $mech->create_body_ok( 2, 'Bgy BSN', id => 2 );
-$bsn->update( { send_method => 'Email' } );
-
-my $dps = $mech->create_body_ok( 3, 'DPS', id => 3 );
-$dps->update( { send_method => 'Open311', endpoint => 'http://dps.endpoint.example.com', jurisdiction => 'FMB', api_key => 'test' } );
-FixMyStreet::DB->resultset('BodyArea')->find_or_create({ area_id => 1, body_id => $dps->id });
-FixMyStreet::DB->resultset('BodyArea')->find_or_create({ area_id => 2, body_id => $dps->id });
-
-# Create contacts for these bodies
-# TODO: log in as a Bgy user, and create a report using the front end,
-# testing that the drop-down has the right things in it, and so on.
-
-$mech->create_contact_ok(
- body_id => $luz->id,
- category => 'Streetlight (BGY)',
- email => 'bgy@example.com',
-);
-$mech->create_contact_ok(
- body_id => $dps->id,
- category => 'Streetlight (DPS)',
- email => 'LIGHT',
-);
-
-# Create a couple of reports
-
-my @reports = $mech->create_problems_for_body( 1, $luz->id, 'Test', {
- cobrand => 'fixmybarangay',
- category => 'Streetlight (BGY)',
-});
-my $luz_report = $reports[0];
-
-@reports = $mech->create_problems_for_body( 1, $dps->id, 'Test', {
- cobrand => 'fixmybarangay',
- category => 'Streetlight (DPS)',
-});
-my $dps_report = $reports[0];
-
-$mech->get_ok( '/report/' . $luz_report->id );
-$mech->get_ok( '/report/' . $dps_report->id );
-
-# Send the reports
-
-$mech->email_count_is(0);
-
-FixMyStreet::override_config {
- SEND_REPORTS_ON_STAGING => 1,
-}, sub {
- FixMyStreet::DB->resultset('Problem')->send_reports('fixmybarangay');
-};
-
-# Check BGY one sent by email
-my $email = $mech->get_email;
-like $email->header('Subject'), qr/Problem Report: Test Test/, 'subject looks okay';
-like $email->header('To'), qr/bgy\@example.com/, 'to line looks correct';
-$mech->clear_emails_ok;
-
-$luz_report->discard_changes;
-$dps_report->discard_changes;
-ok $luz_report->whensent, 'Luz report marked as sent';
-ok $dps_report->whensent, 'DPS report marked as sent';
-is $dps_report->send_method_used, 'Open311', 'DPS report sent via Open311';
-is $dps_report->external_id, 248, 'DPS report has right external ID';
-
-my $fmb_test_email = 'luz_test_user@example.com';
-my $user = FixMyStreet::DB->resultset('User')->find_or_create( { email => $fmb_test_email, from_body => $luz->id, password => 'fmbsecret' } );
-ok $user, "test user does exist";
-
-my $alert = FixMyStreet::DB->resultset('Alert')->find_or_create({
- user => $user,
- parameter => '-0.142497580865087',
- parameter2 => '51.5016605453401',
- alert_type => 'local_problems',
- whensubscribed => '2014-01-01 10:00:00',
- confirmed => 1,
- cobrand => 'fixmybarangay',
-});
-
-FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'fixmybarangay' ],
-}, sub {
- FixMyStreet::DB->resultset('AlertType')->email_alerts();
-};
-
-$mech->email_count_is(1);
-$email = $mech->get_email;
-like $email->body, qr/The following FixMyBarangay reports/, 'Start of email looks correct';
-$mech->clear_emails_ok;
-
-$mech->log_out_ok;
-$mech->get_ok( '/report/' . $luz_report->id );
-$mech->content_lacks( "Remove from site" );
-$mech->content_contains( "Report abuse" );
-
-$mech->post_ok('/report/delete/' . $luz_report->id);
-is $mech->uri->path, '/report/' . $luz_report->id, "should redirect to report page, deletion ignored";
-$luz_report->discard_changes;
-is $luz_report->state, 'confirmed', 'should be confirmed';
-
-$user = $mech->log_in_ok($fmb_test_email);
-
-FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'fixmybarangay' ],
-}, sub {
- $mech->get_ok( '/report/' . $luz_report->id );
-};
-$mech->content_contains( "Remove from site" );
-$mech->content_lacks( "Report abuse" );
-
-$mech->form_id('remove-from-site-form');
-$mech->submit_form();
-is $mech->uri->path, '/report/' . $luz_report->id, "should redirect to report page, deletion successful";
-$luz_report->discard_changes;
-is $luz_report->state, 'hidden', 'should be hidden';
-
-$mech->delete_user($fmb_test_email);
-
-$mech->delete_body($luz);
-$mech->delete_body($bsn);
-$mech->delete_body($dps);
-
-ok $mech->host("www.fixmystreet.com"), "change host back";
-
-done_testing();
diff --git a/t/cobrand/form_extras.t b/t/cobrand/form_extras.t
index 9c20b7ad4..c6f6976d5 100644
--- a/t/cobrand/form_extras.t
+++ b/t/cobrand/form_extras.t
@@ -13,7 +13,6 @@ sub path_to_web_templates {
my $self = shift;
return [
FixMyStreet->path_to( 't/cobrand/form_extras/templates' )->stringify,
- FixMyStreet->path_to( 'templates/web/fixmystreet' )->stringify
];
}
diff --git a/t/cobrand/loading.t b/t/cobrand/loading.t
index 48a10293e..b4738fb63 100644
--- a/t/cobrand/loading.t
+++ b/t/cobrand/loading.t
@@ -44,8 +44,8 @@ FixMyStreet::override_config {
}, sub {
run_host_tests(
'www.fixmystreet.com' => 'FixMyStreet',
- 'reportemptyhomes.com' => 'FixMyStreet',
- 'barnet.fixmystreet.com' => 'FixMyStreet',
+ 'fiksgatami.example.org' => 'FixMyStreet',
+ 'oxfordshire.fixmystreet.com' => 'FixMyStreet',
'some.odd.site.com' => 'FixMyStreet',
);
};
@@ -62,49 +62,49 @@ FixMyStreet::override_config {
# Couple of cobrands, hostname checking and default fallback
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'fiksgatami', 'fixmystreet' ],
}, sub {
run_host_tests(
'www.fixmystreet.com' => 'FixMyStreet',
- 'reportemptyhomes.com' => 'EmptyHomes',
- 'barnet.fixmystreet.com' => 'FixMyStreet', # not in the allowed_cobrands list
+ 'fiksgatami.example.org' => 'FiksGataMi',
+ 'oxfordshire.fixmystreet.com' => 'FixMyStreet', # not in the allowed_cobrands list
'some.odd.site.com' => 'Default',
);
};
-# now enable barnet too and check that it works
+# now enable oxfordshire too and check that it works
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'emptyhomes', 'barnet', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'fiksgatami', 'oxfordshire', 'fixmystreet' ],
}, sub {
run_host_tests(
'www.fixmystreet.com' => 'FixMyStreet',
- 'reportemptyhomes.com' => 'EmptyHomes',
- 'barnet.fixmystreet.com' => 'Barnet', # found now it is in allowed_cobrands
+ 'fiksgatami.example.org' => 'FiksGataMi',
+ 'oxfordshire.fixmystreet.com' => 'Oxfordshire', # found now it is in allowed_cobrands
'some.odd.site.com' => 'Default',
);
};
# And a check with some regex matching
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { 'fixmystreet' => 'empty' }, 'barnet', { 'testing' => 'fixmystreet' } ],
+ ALLOWED_COBRANDS => [ { 'fixmystreet' => 'example' }, 'oxfordshire', { 'testing' => 'fixmystreet' } ],
}, sub {
run_host_tests(
'www.fixmystreet.com' => 'testing',
- 'reportemptyhomes.com' => 'FixMyStreet',
- 'barnet.fixmystreet.com' => 'Barnet',
+ 'fiksgatami.example.org' => 'FixMyStreet',
+ 'oxfordshire.fixmystreet.com' => 'Oxfordshire',
'some.odd.site.com' => 'Default',
);
};
# check that the moniker works as expected both on class and object.
-is FixMyStreet::Cobrand::EmptyHomes->moniker, 'emptyhomes',
+is FixMyStreet::Cobrand::FiksGataMi->moniker, 'fiksgatami',
'class->moniker works';
-is FixMyStreet::Cobrand::EmptyHomes->new->moniker, 'emptyhomes',
+is FixMyStreet::Cobrand::FiksGataMi->new->moniker, 'fiksgatami',
'object->moniker works';
# check is_default works
ok FixMyStreet::Cobrand::Default->is_default, '::Default is default';
-ok !FixMyStreet::Cobrand::EmptyHomes->is_default, '::Emptyhomes is not default';
+ok !FixMyStreet::Cobrand::FiksGataMi->is_default, '::FiksGataMi is not default';
# all done
done_testing();
diff --git a/t/i18n.t b/t/i18n.t
index 550bc2358..3984c91ce 100644
--- a/t/i18n.t
+++ b/t/i18n.t
@@ -14,11 +14,11 @@ 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/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.mo');
# Test the language negotiation works
my $lang = mySociety::Locale::negotiate_language(
- 'en-gb,English,en_GB|cy,Cymraeg,cy_GB|es,Spanish,es_ES',
+ 'en-gb,English,en_GB|es,Spanish,es_ES',
undef,
HTTP::Headers->new(
Accept_Language => 'es,en-gb;q=0.6,en;q=0.4'
@@ -28,27 +28,26 @@ is $lang, 'es', 'Language negotiation works okay';
# Example strings
my $english = "Please enter a valid email";
-my $welsh = "Cofnodwch gyfeiriad e-bost dilys";
+my $norwegian = "Legg til en gyldig e-post";
# set english as the language
mySociety::Locale::negotiate_language( #
- 'en-gb,English,en_GB|cy,Cymraeg,cy_GB', 'en_GB'
+ 'en-gb,English,en_GB|nb,Norwegian,nb_NO', 'en_GB'
);
-mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', 1 );
+mySociety::Locale::gettext_domain( 'FixMyStreet', 1 );
mySociety::Locale::change();
is _($english), $english, "english to english";
-# set to welsh and check for translation
-mySociety::Locale::change('cy');
-is _($english), $welsh, "english to welsh";
+mySociety::Locale::change('nb');
+is _($english), $norwegian, "english to norwegian";
# 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,
+mySociety::Locale::gettext_domain( 'FixMyStreet', 1,
FixMyStreet->path_to('locale')->stringify );
-mySociety::Locale::change('cy');
-is _($english), $welsh, "english to welsh (deep directory)";
+mySociety::Locale::change('nb');
+is _($english), $norwegian, "english to norwegian (deep directory)";
# test that sorting works as expected in the right circumstances...
my @random_sorted = qw( Å Z Ø A );
@@ -59,7 +58,7 @@ my @default_sorted = qw( A Z Å Ø );
SKIP: {
mySociety::Locale::negotiate_language( #
- 'en-gb,English,en_GB|cy,Cymraeg,cy_GB', 'en_GB'
+ 'en-gb,English,en_GB', 'en_GB'
);
mySociety::Locale::change();
@@ -82,7 +81,7 @@ SKIP: {
skip 'Will not pass on Mac', 2 if $^O eq 'darwin';
mySociety::Locale::negotiate_language( #
- 'en-gb,English,en_GB|cy,Cymraeg,cy_GB', 'en_GB'
+ 'en-gb,English,en_GB', 'en_GB'
);
mySociety::Locale::change();
use locale;