diff options
author | Dave Arter <davea@mysociety.org> | 2018-11-07 12:43:39 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-11-07 12:45:49 +0000 |
commit | 49e30befced6b929facbcdc79e81a36ab570d0a7 (patch) | |
tree | 7f420f18e94b3f8942a8151458b6a90f1c342134 /t/open311 | |
parent | 702d0747e13882b46186578291dcd2f4ce17d38a (diff) |
Fix Open311 category group bugs
- Group wasn’t being set correctly by open311-populate-service-list as cobrand attribute
not being updated for each body.
- Extra metadata was being persisted to the DB every time even if nothing had changed,
causing lots of duplicate entries in contacts_history.
Diffstat (limited to 't/open311')
-rw-r--r-- | t/open311/populate-service-list.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/t/open311/populate-service-list.t b/t/open311/populate-service-list.t index 313d5c809..1415c7b2a 100644 --- a/t/open311/populate-service-list.t +++ b/t/open311/populate-service-list.t @@ -46,14 +46,16 @@ $bromley->body_areas->find_or_create({ } ); for my $test ( - { cobrand => 'tester', groups => 0 }, - { cobrand => 'testergroups', groups => 1 }, + { desc => 'groups not set for new contacts', cobrand => 'tester', groups => 0, delete => 1 }, + { desc => 'groups set for new contacts', cobrand => 'testergroups', groups => 1, delete => 1}, + { desc => 'groups removed for existing contacts', cobrand => 'tester', groups => 0, delete => 0 }, + { desc => 'groups added for existing contacts', cobrand => 'testergroups', groups => 1, delete => 0}, ) { FixMyStreet::override_config { ALLOWED_COBRANDS => [ $test->{cobrand} ], }, sub { - subtest 'check basic functionality' => sub { - FixMyStreet::DB->resultset('Contact')->search( { body_id => 1 } )->delete(); + subtest 'check basic functionality, ' . $test->{desc} => sub { + FixMyStreet::DB->resultset('Contact')->search( { body_id => 1 } )->delete() if $test->{delete}; my $service_list = get_xml_simple_object( get_standard_xml() ); |