From 1bb94cd0bf0821927b3f449d832a9982b0397fa9 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 31 May 2017 12:48:17 +0100 Subject: Auto-add strict/warnings/Test::More with TestMech. --- t/app/script/archive_old_enquiries.t | 3 --- 1 file changed, 3 deletions(-) (limited to 't/app/script/archive_old_enquiries.t') diff --git a/t/app/script/archive_old_enquiries.t b/t/app/script/archive_old_enquiries.t index e87d6a0f8..589aeceda 100644 --- a/t/app/script/archive_old_enquiries.t +++ b/t/app/script/archive_old_enquiries.t @@ -1,6 +1,3 @@ -use strict; -use warnings; -use Test::More; use FixMyStreet::TestMech; use FixMyStreet::Script::ArchiveOldEnquiries; -- cgit v1.2.3 From e57cbf483790bedfef6496be3c7ffa42882c3ffc Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 13 Jun 2017 18:39:05 +0100 Subject: [UK] Remove requirement for fixed body IDs. Historically in UK cobrands, bodies have had IDs the same as the MapIt area ID they cover. This can be confusing (if you are setting up a dev environment, say) and should not be necessary. This commit removes the requirement entirely, by switching any ID checks to either the name of the body, or the actual area it covers. One note: the body name in the test has to match so that we do not get two bodies both covering 2237 created. This will not be necessary when the tests are compartmentalized in the next commit. --- t/app/script/archive_old_enquiries.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 't/app/script/archive_old_enquiries.t') diff --git a/t/app/script/archive_old_enquiries.t b/t/app/script/archive_old_enquiries.t index 589aeceda..148f73cf2 100644 --- a/t/app/script/archive_old_enquiries.t +++ b/t/app/script/archive_old_enquiries.t @@ -12,8 +12,10 @@ my $opts = { }; my $user = $mech->create_user_ok('test@example.com', name => 'Test User'); -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); -my $west_oxon = $mech->create_body_ok(2420, 'West Oxfordshire District Council', id => 2420); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); +my $west_oxon = $mech->create_body_ok(2420, 'West Oxfordshire District Council'); + +$opts->{body} = $oxfordshire->id; subtest 'sets reports to the correct status' => sub { FixMyStreet::override_config { -- cgit v1.2.3 From 3b72526db1cdb4695f61a188261351ddd2aea395 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 14 Jun 2017 13:59:43 +0100 Subject: Run each test file in a transaction. This means that the tests can be run in parallel. --- t/app/script/archive_old_enquiries.t | 5 ----- 1 file changed, 5 deletions(-) (limited to 't/app/script/archive_old_enquiries.t') diff --git a/t/app/script/archive_old_enquiries.t b/t/app/script/archive_old_enquiries.t index 148f73cf2..fb1949d9f 100644 --- a/t/app/script/archive_old_enquiries.t +++ b/t/app/script/archive_old_enquiries.t @@ -155,8 +155,3 @@ subtest 'user with new reports does not get email' => sub { }; done_testing(); - -END { - $mech->delete_user($user); - $mech->delete_body($oxfordshire); -} -- cgit v1.2.3 From a51c4dff85fa403978a313b4330081fd3ca9993c Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 25 Aug 2017 12:44:30 +0100 Subject: Make sure gettext domain specified in all tests. --- t/app/script/archive_old_enquiries.t | 2 -- 1 file changed, 2 deletions(-) (limited to 't/app/script/archive_old_enquiries.t') diff --git a/t/app/script/archive_old_enquiries.t b/t/app/script/archive_old_enquiries.t index fb1949d9f..e1adeec85 100644 --- a/t/app/script/archive_old_enquiries.t +++ b/t/app/script/archive_old_enquiries.t @@ -1,8 +1,6 @@ use FixMyStreet::TestMech; use FixMyStreet::Script::ArchiveOldEnquiries; -mySociety::Locale::gettext_domain( 'FixMyStreet' ); - my $mech = FixMyStreet::TestMech->new(); $mech->clear_emails_ok; -- cgit v1.2.3