aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/sendreport
diff options
context:
space:
mode:
Diffstat (limited to 't/app/sendreport')
-rw-r--r--t/app/sendreport/email.t15
1 files changed, 7 insertions, 8 deletions
diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t
index b2cab42ed..65cd7bfa8 100644
--- a/t/app/sendreport/email.t
+++ b/t/app/sendreport/email.t
@@ -7,11 +7,12 @@ use Test::More;
use FixMyStreet;
use FixMyStreet::App;
-use FixMyStreet::DB::Result::Contact;
use FixMyStreet::SendReport::Email;
use FixMyStreet::TestMech;
use mySociety::Locale;
+ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
+
my $e = FixMyStreet::SendReport::Email->new();
# area id 1000
@@ -19,14 +20,10 @@ my $params = { id => 1000, name => 'Council of the Thousand' };
my $body = FixMyStreet::App->model('DB::Body')->find_or_create($params);
ok $body, "found/created body";
-my $contact = FixMyStreet::App->model('DB::Contact')->find_or_create(
+my $contact = $mech->create_contact_ok(
email => 'council@example.com',
body_id => 1000,
category => 'category',
- confirmed => 1,
- deleted => 0,
- editor => 'test suite',
- whenedited => DateTime->now,
note => '',
);
@@ -78,6 +75,8 @@ foreach my $test ( {
};
}
-$contact->delete;
-
done_testing();
+
+END {
+ $mech->delete_body($body);
+}