diff options
author | Dave Arter <davea@mysociety.org> | 2018-04-04 17:36:06 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-04 17:37:26 +0100 |
commit | 6666bcd1157e1aa5e6ea336339dc89c516267b15 (patch) | |
tree | dca4823d8308ab1168ae0ed4585ac8734c4ecc9f /t/open311 | |
parent | 49289d4f231b570004ed4dd4d54ffe1d2d172623 (diff) |
Correctly assign problem categories in GetServiceRequests
FMS uses the Contact->email field for the Open311 service code,
and the Contact->category field is the user-friendly service name.
The wrong value was being compared previously, resulting in all
fetched problems being assigned to the 'Other' category.
Diffstat (limited to 't/open311')
-rw-r--r-- | t/open311/getservicerequests.t | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/t/open311/getservicerequests.t b/t/open311/getservicerequests.t index a28c6e3cf..c59e5cc41 100644 --- a/t/open311/getservicerequests.t +++ b/t/open311/getservicerequests.t @@ -12,7 +12,7 @@ my $mech = FixMyStreet::TestMech->new; my $user = $mech->create_user_ok('system_user@example.com', name => 'test users'); my $body = $mech->create_body_ok(2482, 'Bromley'); -my $contact = $mech->create_contact_ok( body_id => $body->id, category => 'sidewalks', email => 'sidewalks@example.com' ); +my $contact = $mech->create_contact_ok( body_id => $body->id, category => 'Sidewalk and Curb Issues', email => 'sidewalks' ); my $dtf = DateTime::Format::W3CDTF->new; @@ -90,13 +90,14 @@ subtest 'basic parsing checks' => sub { )->first; ok $p, 'Found problem'; + is $p->title, 'Sidewalk and Curb Issues problem', 'correct problem title'; is $p->detail, 'This is a sidewalk problem', 'correct problem description'; is $p->created, $p1_date, 'Problem has correct creation date'; is $p->confirmed, $p1_date, 'Problem has correct confirmed date'; is $p->whensent, $p1_date, 'Problem has whensent set'; is $p->state, 'confirmed', 'correct problem state'; is $p->user->id, $user->id, 'user set to system user'; - is $p->category, 'sidewalks', 'correct problem category'; + is $p->category, 'Sidewalk and Curb Issues', 'correct problem category'; my $p2 = FixMyStreet::DB->resultset('Problem')->search( { external_id => 638345 } )->first; ok $p2, 'second problem found'; |