diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2013-12-09 11:03:24 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2013-12-09 16:52:48 +0000 |
commit | b1334a79073d622d99826bfb571a0c03c0d466f7 (patch) | |
tree | 44beb49c7959699323d7bee22d6451180c519490 /t/cobrand/zurich.t | |
parent | 8283029eea61f5e5bf915487d3950a7e849b1596 (diff) |
[Zurich] test factor out cleanup() routine
Diffstat (limited to 't/cobrand/zurich.t')
-rw-r--r-- | t/cobrand/zurich.t | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index 0cb4e36cf..530fde92b 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -26,10 +26,17 @@ sub send_reports_for_zurich { FixMyStreet::App->model('DB::Problem')->send_reports('zurich'); }; } - use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; +sub cleanup { + $mech->delete_problems_for_body( 2 ); + $mech->delete_user( 'dm1@example.org' ); + $mech->delete_user( 'sdm1@example.org' ); +} + +cleanup(); + # Front page test ok $mech->host("zurich.example.com"), "change host to Zurich"; FixMyStreet::override_config { @@ -548,9 +555,7 @@ subtest "test stats" => sub { $mech->log_out_ok; }; -$mech->delete_problems_for_body( 2 ); -$mech->delete_user( 'dm1@example.org' ); -$mech->delete_user( 'sdm1@example.org' ); +cleanup(); ok $mech->host("www.fixmystreet.com"), "change host back"; |