aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/sendreport/open311.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/sendreport/open311.t')
-rw-r--r--t/app/sendreport/open311.t17
1 files changed, 7 insertions, 10 deletions
diff --git a/t/app/sendreport/open311.t b/t/app/sendreport/open311.t
index c4c17577c..32564dbd8 100644
--- a/t/app/sendreport/open311.t
+++ b/t/app/sendreport/open311.t
@@ -1,7 +1,5 @@
-use strict;
-use warnings;
+use FixMyStreet::Test;
-use Test::More;
use Test::Deep;
use Open311;
@@ -159,20 +157,19 @@ sub test_overrides {
FixMyStreet::override_config {
ALLOWED_COBRANDS => ['fixmystreet', 'oxfordshire', 'bromley', 'westberkshire', 'greenwich'],
}, sub {
- my $db = FixMyStreet::DB->storage->schema;
- $db->txn_begin;
+ my $db = FixMyStreet::DB->schema;
+ #$db->txn_begin;
my $params = { id => $input->{body_id}, name => $input->{body_name} };
my $body = $db->resultset('Body')->find_or_create($params);
- $body->body_areas->create({ area_id => $input->{body_id} });
+ $body->body_areas->find_or_create({ area_id => $input->{body_id} });
ok $body, "found/created body " . $input->{body_name};
$body->update({ can_be_devolved => 1 });
my $contact = $body->contacts->find_or_create(
- confirmed => 1,
+ state => 'confirmed',
email => 'ZZ',
category => 'ZZ',
- deleted => 0,
editor => 'test suite',
note => '',
whenedited => DateTime->now,
@@ -182,7 +179,7 @@ sub test_overrides {
);
$contact->update({ send_method => 'Open311', endpoint => 'http://example.com/open311' });
- my $user = $db->resultset('User')->create( {
+ my $user = $db->resultset('User')->find_or_create( {
name => 'Fred Bloggs',
email => TEST_USER_EMAIL,
password => 'dummy',
@@ -215,7 +212,7 @@ sub test_overrides {
or diag Dumper( Open311->_get_test_data );
Open311->_reset_test_data();
- $db->txn_rollback;
+ #$db->txn_rollback;
};
}
}