aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/.gitignore2
-rw-r--r--perllib/FixMyStreet/TestAppProve.pm17
-rw-r--r--t/cobrand/zurich.t3
3 files changed, 20 insertions, 2 deletions
diff --git a/conf/.gitignore b/conf/.gitignore
index 6e77101a1..86ecc7e03 100644
--- a/conf/.gitignore
+++ b/conf/.gitignore
@@ -1,6 +1,6 @@
/general.yml
/general.yml.deployed
-/general.test-autogenerated.yml
+/general.test-autogenerated*.yml
/httpd.conf
/httpd.conf.deployed
/crontab
diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm
index 75e9fe0a4..f2584fc33 100644
--- a/perllib/FixMyStreet/TestAppProve.pm
+++ b/perllib/FixMyStreet/TestAppProve.pm
@@ -2,6 +2,8 @@ use strict; use warnings;
package FixMyStreet::TestAppProve;
use App::Prove;
+use sigtrap qw(handler signal_handler normal-signals);
+
use YAML ();
use Path::Tiny 'path';
use Test::PostgreSQL;
@@ -18,6 +20,19 @@ see bin/run-tests for usage
=cut
+sub cleanup {
+ unlink "conf/general.test-autogenerated.$$.yml";
+}
+
+sub signal_handler {
+ cleanup();
+ exit(0);
+}
+
+END {
+ cleanup();
+}
+
sub run {
my ($class, @args) = @_;
local @ARGV = @args;
@@ -71,7 +86,7 @@ sub run {
$config->{FMS_DB_PASS} = '';
}
- my $config_out = 'general.test-autogenerated';
+ my $config_out = "general.test-autogenerated.$$";
path("conf/$config_out.yml")->spew( YAML::Dump($config) );
local $ENV{FMS_OVERRIDE_CONFIG} = $config_out;
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index f1540e2b8..53d8dba0f 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -115,6 +115,7 @@ my @reports = $mech->create_problems_for_body( 1, $division->id, 'Test', {
confirmed => undef,
cobrand => 'zurich',
photo => $sample_photo,
+ areas => ',423017,',
});
my $report = $reports[0];
@@ -482,6 +483,7 @@ $mech->clear_emails_ok;
confirmed => undef,
cobrand => 'zurich',
photo => $sample_photo,
+ areas => ',423017,',
});
$report = $reports[0];
@@ -523,6 +525,7 @@ $mech->email_count_is(0);
confirmed => undef,
cobrand => 'zurich',
photo => $sample_photo,
+ areas => ',423017,',
});
$report = $reports[0];