diff options
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index c22789fb0..166ba116f 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -10,6 +10,7 @@ BEGIN { } use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; +use t::Mock::MapIt; use Test::More; use Web::Scraper; use Carp; @@ -611,6 +612,7 @@ sub delete_body { my $body = shift; $mech->delete_problems_for_body($body->id); + $mech->delete_defect_type($_) for $body->defect_types; $mech->delete_contact($_) for $body->contacts; $mech->delete_user($_) for $body->users; $_->delete for $body->response_templates; @@ -642,6 +644,14 @@ sub delete_problems_for_body { } } +sub delete_defect_type { + my $mech = shift; + my $defect_type = shift; + + $defect_type->contact_defect_types->delete_all; + $defect_type->delete; +} + sub create_contact_ok { my $self = shift; my %contact_params = ( |