diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-09 20:07:14 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-09 20:07:14 +0100 |
commit | f0cd397c755ecbba7f03f3d4ec2eb9810681167b (patch) | |
tree | ad03a40151b3293e396b3ac57db3b9a71552a4b0 | |
parent | 0c31945416238d7eb06543c107214adfd4b83734 (diff) | |
parent | 3f29eef5b0efc778c38ec0d564af573db345f38f (diff) |
Merge branch 'test-tweaks'
-rw-r--r-- | conf/.gitignore | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/TestAppProve.pm | 17 | ||||
-rw-r--r-- | t/cobrand/zurich.t | 3 |
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]; |