From ce1b3ec61fdaa954c26e55b8ce8cd1ad619b3538 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 29 Jun 2020 15:00:55 +0100 Subject: [Bromley] Add waste service lookup. This creates an integration to view bin collection days, and placeholders for the start of a non-map property-based reporting flow. --- t/app/controller/waste.t | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 t/app/controller/waste.t (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t new file mode 100644 index 000000000..77b1ef5bc --- /dev/null +++ b/t/app/controller/waste.t @@ -0,0 +1,53 @@ +use Test::MockModule; +use FixMyStreet::TestMech; + +my $mech = FixMyStreet::TestMech->new; + +FixMyStreet::override_config { + ALLOWED_COBRANDS => ['bromley', 'fixmystreet'], + COBRAND_FEATURES => { echo => { bromley => { sample_data => 1 } }, waste => { bromley => 1 } }, +}, sub { + $mech->host('bromley.fixmystreet.com'); + subtest 'Missing address lookup' => sub { + $mech->get_ok('/waste'); + $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); + $mech->submit_form_ok({ with_fields => { address => 'missing' } }); + $mech->content_contains('can’t find your address'); + }; + subtest 'Address lookup' => sub { + $mech->get_ok('/waste'); + $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); + $mech->submit_form_ok({ with_fields => { address => '1000000002' } }); + $mech->content_contains('2 Example Street'); + $mech->content_contains('Food Waste'); + }; +}; + +package SOAP::Result; +sub result { return $_[0]->{result}; } +sub new { my $c = shift; bless { @_ }, $c; } + +package main; + +FixMyStreet::override_config { + ALLOWED_COBRANDS => 'bromley', + COBRAND_FEATURES => { echo => { bromley => { url => 'http://example.org' } }, waste => { bromley => 1 } }, +}, sub { + subtest 'Address lookup, mocking SOAP call' => sub { + my $integ = Test::MockModule->new('SOAP::Lite'); + $integ->mock(call => sub { + return SOAP::Result->new(result => { + PointInfo => [ + { Description => '1 Example Street', SharedRef => { Value => { anyType => 1000000001 } } }, + { Description => '2 Example Street', SharedRef => { Value => { anyType => 1000000002 } } }, + ], + }); + }); + + $mech->get_ok('/waste'); + $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); + $mech->content_contains('2 Example Street'); + }; +}; + +done_testing; -- cgit v1.2.3 From dbde76a5090e772c806bd189426ee078b9b7e4ba Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 29 Jun 2020 16:07:52 +0100 Subject: [Bromley] Add waste reporting service. This creates a non-map property-based reporting flow for reporting missed collections and requesting new containers. Such reports are always private, in categories that are hidden from the map filters and never shown on .com. --- t/app/controller/waste.t | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 77b1ef5bc..454a593a6 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -1,8 +1,35 @@ use Test::MockModule; use FixMyStreet::TestMech; +FixMyStreet::App->log->disable('info'); +END { FixMyStreet::App->log->enable('info'); } + my $mech = FixMyStreet::TestMech->new; +my $body = $mech->create_body_ok(2482, 'Bromley Council'); +my $user = $mech->create_user_ok('test@example.net', name => 'Normal User'); +my $staff_user = $mech->create_user_ok('staff@example.org', from_body => $body, name => 'Staff User'); +$staff_user->user_body_permissions->create({ body => $body, permission_type => 'contribute_as_another_user' }); +$staff_user->user_body_permissions->create({ body => $body, permission_type => 'report_mark_private' }); + +sub create_contact { + my ($params, @extra) = @_; + my $contact = $mech->create_contact_ok(body => $body, %$params); + $contact->set_extra_metadata(group => ['Waste']); + $contact->set_extra_fields( + { code => 'uprn', required => 1, automated => 'hidden_field' }, + { code => 'service_id', required => 0, automated => 'hidden_field' }, + @extra, + ); + $contact->update; +} + +create_contact({ category => 'Report missed collection', email => 'missed' }); +create_contact({ category => 'Request new container', email => 'request' }, + { code => 'Quantity', required => 1, automated => 'hidden_field' }, + { code => 'Container_Type', required => 1, automated => 'hidden_field' }, +); + FixMyStreet::override_config { ALLOWED_COBRANDS => ['bromley', 'fixmystreet'], COBRAND_FEATURES => { echo => { bromley => { sample_data => 1 } }, waste => { bromley => 1 } }, @@ -21,6 +48,64 @@ FixMyStreet::override_config { $mech->content_contains('2 Example Street'); $mech->content_contains('Food Waste'); }; + subtest 'Report a missed bin' => sub { + $mech->follow_link_ok({ text => 'Report a missed collection' }); + $mech->submit_form_ok({ form_number => 2 }); + $mech->content_contains('Please specify what was missed'); + $mech->submit_form_ok({ with_fields => { 'service-101' => 1 } }); + $mech->submit_form_ok({ with_fields => { name => "Test" } }); + $mech->content_contains('Please enter your full name'); + $mech->content_contains('Please specify at least one of phone or email'); + $mech->submit_form_ok({ with_fields => { name => "Test McTest", email => 'test@example.org' } }); + $mech->content_contains('Refuse collection'); + $mech->content_contains('Test McTest'); + $mech->content_contains('test@example.org'); + $mech->submit_form_ok({ form_number => 3 }); + $mech->submit_form_ok({ with_fields => { name => "Test McTest", email => $user->email } }); + $mech->content_contains($user->email); + $mech->submit_form_ok({ with_fields => { process => 'summary' } }); + $mech->content_contains('Your report has been sent'); + + is $user->alerts->count, 1; + }; + subtest 'Check report visibility' => sub { + my $report = FixMyStreet::DB->resultset("Problem")->first; + my $res = $mech->get('/report/' . $report->id); + is $res->code, 403; + $mech->log_in_ok($user->email); + $mech->get_ok('/report/' . $report->id); + $mech->log_in_ok($staff_user->email); + $mech->get_ok('/report/' . $report->id); + + $mech->host('www.fixmystreet.com'); + $res = $mech->get('/report/' . $report->id); + is $res->code, 404; + $mech->log_in_ok($user->email); + $res = $mech->get('/report/' . $report->id); + is $res->code, 404; + $mech->log_in_ok($staff_user->email); + $res = $mech->get('/report/' . $report->id); + is $res->code, 404; + $mech->host('bromley.fixmystreet.com'); + }; + subtest 'Request a new container' => sub { + $mech->get_ok('/waste/uprn/1000000002/request'); + $mech->submit_form_ok({ form_number => 2 }); + $mech->content_contains('Please specify what you need'); + $mech->submit_form_ok({ with_fields => { 'container-1' => 1 } }); + $mech->content_contains('Quantity field is required'); + $mech->submit_form_ok({ with_fields => { 'container-1' => 1, 'quantity-1' => 2 } }); + $mech->submit_form_ok({ with_fields => { name => "Test McTest", email => $user->email } }); + $mech->content_contains('Green Box'); + $mech->content_contains('Test McTest'); + $mech->content_contains($user->email); + $mech->submit_form_ok({ with_fields => { process => 'summary' } }); + $mech->content_contains('Your request has been sent'); + my $report = FixMyStreet::DB->resultset("Problem")->search(undef, { order_by => { -desc => 'id' } })->first; + is $report->get_extra_field_value('uprn'), 1000000002; + is $report->get_extra_field_value('Quantity'), 2; + is $report->get_extra_field_value('Container_Type'), 1; + }; }; package SOAP::Result; -- cgit v1.2.3 From 613f45c6514ace275b3a49a5d50f7b83ed536b5f Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 29 Jun 2020 16:08:54 +0100 Subject: [Bromley] Add general enquiries. This adds general enquiries to the reporting flow. --- t/app/controller/waste.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 454a593a6..bbd0cd00a 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -29,6 +29,8 @@ create_contact({ category => 'Request new container', email => 'request' }, { code => 'Quantity', required => 1, automated => 'hidden_field' }, { code => 'Container_Type', required => 1, automated => 'hidden_field' }, ); +create_contact({ category => 'General enquiry', email => 'general' }, + { code => 'Notes', description => 'Notes', required => 1, datatype => 'text' }); FixMyStreet::override_config { ALLOWED_COBRANDS => ['bromley', 'fixmystreet'], @@ -106,6 +108,29 @@ FixMyStreet::override_config { is $report->get_extra_field_value('Quantity'), 2; is $report->get_extra_field_value('Container_Type'), 1; }; + subtest 'General enquiry, bad data' => sub { + $mech->get_ok('/waste/uprn/1000000002/enquiry'); + is $mech->uri->path, '/waste/uprn/1000000002'; + $mech->get_ok('/waste/uprn/1000000002/enquiry?category=Bad'); + is $mech->uri->path, '/waste/uprn/1000000002'; + $mech->get_ok('/waste/uprn/1000000002/enquiry?service=1'); + is $mech->uri->path, '/waste/uprn/1000000002'; + }; + subtest 'General enquiry, on behalf of someone else' => sub { + $mech->log_in_ok($staff_user->email); + $mech->get_ok('/waste/uprn/1000000002/enquiry?category=General+enquiry&service_id=537'); + $mech->submit_form_ok({ with_fields => { extra_Notes => 'Some notes' } }); + $mech->submit_form_ok({ with_fields => { name => "Test McTest", email => $user->email } }); + $mech->content_contains('Some notes'); + $mech->content_contains('Test McTest'); + $mech->content_contains($user->email); + $mech->submit_form_ok({ with_fields => { process => 'summary' } }); + $mech->content_contains('Your enquiry has been sent'); + my $report = FixMyStreet::DB->resultset("Problem")->search(undef, { order_by => { -desc => 'id' } })->first; + is $report->get_extra_field_value('Notes'), 'Some notes'; + is $report->user->email, $user->email; + is $report->get_extra_metadata('contributed_by'), $staff_user->id; + }; }; package SOAP::Result; -- cgit v1.2.3 From bc19b9e00f3d59a2f0694f2fcc3aab54fef35e9e Mon Sep 17 00:00:00 2001 From: M Somerville Date: Mon, 19 Oct 2020 11:05:04 +0100 Subject: [Bromley] ICal generation. --- t/app/controller/waste.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index bbd0cd00a..9bc03e169 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -116,6 +116,18 @@ FixMyStreet::override_config { $mech->get_ok('/waste/uprn/1000000002/enquiry?service=1'); is $mech->uri->path, '/waste/uprn/1000000002'; }; + subtest 'Checking calendar' => sub { + $mech->follow_link_ok({ text => 'Add to your calendar (.ics file)' }); + $mech->content_contains('BEGIN:VCALENDAR'); + my @events = split /BEGIN:VEVENT/, $mech->encoded_content; + shift @events; # Header + my $i = 0; + foreach (@events) { + $i++ if /DTSTART;VALUE=DATE:20200701/ && /SUMMARY:Refuse collection/; + $i++ if /DTSTART;VALUE=DATE:20200708/ && /SUMMARY:Paper & Cardboard/; + } + is $i, 2, 'Two events from the sample data in the calendar'; + }; subtest 'General enquiry, on behalf of someone else' => sub { $mech->log_in_ok($staff_user->email); $mech->get_ok('/waste/uprn/1000000002/enquiry?category=General+enquiry&service_id=537'); -- cgit v1.2.3 From 6337ebfd91a87eaf5efa077c5f9a9eff286c1f76 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 15 Jun 2020 21:02:37 +0100 Subject: [Bromley] Report missed bin within 2 working days. --- t/app/controller/waste.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 9bc03e169..85536981b 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -1,9 +1,15 @@ +use utf8; use Test::MockModule; +use Test::MockTime qw(:all); use FixMyStreet::TestMech; FixMyStreet::App->log->disable('info'); END { FixMyStreet::App->log->enable('info'); } +# Mock fetching bank holidays +my $uk = Test::MockModule->new('FixMyStreet::Cobrand::UK'); +$uk->mock('_fetch_url', sub { '{}' }); + my $mech = FixMyStreet::TestMech->new; my $body = $mech->create_body_ok(2482, 'Bromley Council'); @@ -44,6 +50,7 @@ FixMyStreet::override_config { $mech->content_contains('can’t find your address'); }; subtest 'Address lookup' => sub { + set_fixed_time('2020-05-28T17:00:00Z'); # After sample data collection $mech->get_ok('/waste'); $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); $mech->submit_form_ok({ with_fields => { address => '1000000002' } }); @@ -51,7 +58,15 @@ FixMyStreet::override_config { $mech->content_contains('Food Waste'); }; subtest 'Report a missed bin' => sub { + $mech->content_contains('service-101', 'Can report, last collection was 27th'); + $mech->content_contains('service-537', 'Can report, last collection was 27th'); + $mech->content_lacks('service-535', 'Cannot report, last collection was 20th'); + $mech->content_lacks('service-542', 'Cannot report, last collection was 18th'); $mech->follow_link_ok({ text => 'Report a missed collection' }); + $mech->content_contains('service-101', 'Checkbox, last collection was 27th'); + $mech->content_contains('service-537', 'Checkbox, last collection was 27th'); + $mech->content_lacks('service-535', 'No checkbox, last collection was 20th'); + $mech->content_lacks('service-542', 'No checkbox, last collection was 18th'); $mech->submit_form_ok({ form_number => 2 }); $mech->content_contains('Please specify what was missed'); $mech->submit_form_ok({ with_fields => { 'service-101' => 1 } }); -- cgit v1.2.3 From ac82484fb2e2acc95012d8ba0894b1165743b8ea Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 17 Jun 2020 16:57:01 +0100 Subject: [Bromley] Send sent confirmation for waste reports --- t/app/controller/waste.t | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 85536981b..9c7b9a3ac 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -2,6 +2,7 @@ use utf8; use Test::MockModule; use Test::MockTime qw(:all); use FixMyStreet::TestMech; +use FixMyStreet::Script::Reports; FixMyStreet::App->log->disable('info'); END { FixMyStreet::App->log->enable('info'); } @@ -30,17 +31,18 @@ sub create_contact { $contact->update; } -create_contact({ category => 'Report missed collection', email => 'missed' }); -create_contact({ category => 'Request new container', email => 'request' }, +create_contact({ category => 'Report missed collection', email => 'missed@example.org' }); +create_contact({ category => 'Request new container', email => 'request@example.org' }, { code => 'Quantity', required => 1, automated => 'hidden_field' }, { code => 'Container_Type', required => 1, automated => 'hidden_field' }, ); -create_contact({ category => 'General enquiry', email => 'general' }, +create_contact({ category => 'General enquiry', email => 'general@example.org' }, { code => 'Notes', description => 'Notes', required => 1, datatype => 'text' }); FixMyStreet::override_config { ALLOWED_COBRANDS => ['bromley', 'fixmystreet'], COBRAND_FEATURES => { echo => { bromley => { sample_data => 1 } }, waste => { bromley => 1 } }, + MAPIT_URL => 'http://mapit.uk/', }, sub { $mech->host('bromley.fixmystreet.com'); subtest 'Missing address lookup' => sub { @@ -82,6 +84,12 @@ FixMyStreet::override_config { $mech->content_contains($user->email); $mech->submit_form_ok({ with_fields => { process => 'summary' } }); $mech->content_contains('Your report has been sent'); + FixMyStreet::Script::Reports::send(); + my @emails = $mech->get_email; + is $emails[0]->header('To'), '"Bromley Council" '; + is $emails[1]->header('To'), $user->email; + my $body = $mech->get_text_body_from_email($emails[1]); + like $body, qr/Your report to Bromley Council has been logged/; is $user->alerts->count, 1; }; -- cgit v1.2.3 From b2735e814c73fe76c8526563b7c5473281938833 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 18 Jun 2020 13:43:49 +0100 Subject: [Bromley] No updates on waste reports. --- t/app/controller/waste.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 9c7b9a3ac..fe1b369d9 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -99,8 +99,12 @@ FixMyStreet::override_config { is $res->code, 403; $mech->log_in_ok($user->email); $mech->get_ok('/report/' . $report->id); + $mech->content_lacks('Provide an update'); + $report->update({ state => 'fixed - council' }); $mech->log_in_ok($staff_user->email); $mech->get_ok('/report/' . $report->id); + $mech->content_lacks('Provide an update'); + $mech->content_contains( 'See your bin collections' ); $mech->host('www.fixmystreet.com'); $res = $mech->get('/report/' . $report->id); -- cgit v1.2.3 From d90e1157ee31c374248da0db42b70456c37ddd5b Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 19 Jun 2020 14:56:07 +0100 Subject: [Bromley] Look for open events. --- t/app/controller/waste.t | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index fe1b369d9..aac898da9 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -59,6 +59,9 @@ FixMyStreet::override_config { $mech->content_contains('2 Example Street'); $mech->content_contains('Food Waste'); }; + subtest 'Thing already requested' => sub { + $mech->content_contains('A food waste collection has been reported as missed'); + }; subtest 'Report a missed bin' => sub { $mech->content_contains('service-101', 'Can report, last collection was 27th'); $mech->content_contains('service-537', 'Can report, last collection was 27th'); @@ -135,6 +138,10 @@ FixMyStreet::override_config { is $report->get_extra_field_value('Quantity'), 2; is $report->get_extra_field_value('Container_Type'), 1; }; + subtest 'Thing already requested' => sub { + $mech->get_ok('/waste/uprn/1000000002'); + $mech->content_contains('A new paper & cardboard container request has been made'); + }; subtest 'General enquiry, bad data' => sub { $mech->get_ok('/waste/uprn/1000000002/enquiry'); is $mech->uri->path, '/waste/uprn/1000000002'; -- cgit v1.2.3 From 1a90fc2428eeca48347c8dc31f00ca6053e772bf Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 28 Jul 2020 14:23:04 +0100 Subject: [Bromley] Check service unit as well as property. If someone else in a block of flats has reported a missed collection, others in the same service unit should not be able to report also. Fixes https://github.com/mysociety/fixmystreet-commercial/issues/1945 --- t/app/controller/waste.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index aac898da9..c86802631 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -61,15 +61,16 @@ FixMyStreet::override_config { }; subtest 'Thing already requested' => sub { $mech->content_contains('A food waste collection has been reported as missed'); + $mech->content_contains('A paper & cardboard collection has been reported as missed'); # as part of service unit, not property }; subtest 'Report a missed bin' => sub { $mech->content_contains('service-101', 'Can report, last collection was 27th'); - $mech->content_contains('service-537', 'Can report, last collection was 27th'); + $mech->content_lacks('service-537', 'Cannot report, last collection was 27th but the service unit has a report'); $mech->content_lacks('service-535', 'Cannot report, last collection was 20th'); $mech->content_lacks('service-542', 'Cannot report, last collection was 18th'); $mech->follow_link_ok({ text => 'Report a missed collection' }); $mech->content_contains('service-101', 'Checkbox, last collection was 27th'); - $mech->content_contains('service-537', 'Checkbox, last collection was 27th'); + $mech->content_lacks('service-537', 'No checkbox, last collection was 27th but the service unit has a report'); $mech->content_lacks('service-535', 'No checkbox, last collection was 20th'); $mech->content_lacks('service-542', 'No checkbox, last collection was 18th'); $mech->submit_form_ok({ form_number => 2 }); -- cgit v1.2.3 From 0b97468330ab7146f16dfe4060a63d28ce445fa6 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 12 Nov 2020 11:48:24 +0000 Subject: [Bromley] Use property ID, rather than UPRN. --- t/app/controller/waste.t | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 't/app/controller/waste.t') diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index c86802631..748904995 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -25,6 +25,7 @@ sub create_contact { $contact->set_extra_metadata(group => ['Waste']); $contact->set_extra_fields( { code => 'uprn', required => 1, automated => 'hidden_field' }, + { code => 'property_id', required => 1, automated => 'hidden_field' }, { code => 'service_id', required => 0, automated => 'hidden_field' }, @extra, ); @@ -55,7 +56,7 @@ FixMyStreet::override_config { set_fixed_time('2020-05-28T17:00:00Z'); # After sample data collection $mech->get_ok('/waste'); $mech->submit_form_ok({ with_fields => { postcode => 'BR1 1AA' } }); - $mech->submit_form_ok({ with_fields => { address => '1000000002' } }); + $mech->submit_form_ok({ with_fields => { address => '12345' } }); $mech->content_contains('2 Example Street'); $mech->content_contains('Food Waste'); }; @@ -108,7 +109,7 @@ FixMyStreet::override_config { $mech->log_in_ok($staff_user->email); $mech->get_ok('/report/' . $report->id); $mech->content_lacks('Provide an update'); - $mech->content_contains( 'See your bin collections' ); + $mech->content_contains( 'See your bin collections' ); $mech->host('www.fixmystreet.com'); $res = $mech->get('/report/' . $report->id); @@ -122,7 +123,7 @@ FixMyStreet::override_config { $mech->host('bromley.fixmystreet.com'); }; subtest 'Request a new container' => sub { - $mech->get_ok('/waste/uprn/1000000002/request'); + $mech->get_ok('/waste/12345/request'); $mech->submit_form_ok({ form_number => 2 }); $mech->content_contains('Please specify what you need'); $mech->submit_form_ok({ with_fields => { 'container-1' => 1 } }); @@ -140,16 +141,16 @@ FixMyStreet::override_config { is $report->get_extra_field_value('Container_Type'), 1; }; subtest 'Thing already requested' => sub { - $mech->get_ok('/waste/uprn/1000000002'); + $mech->get_ok('/waste/12345'); $mech->content_contains('A new paper & cardboard container request has been made'); }; subtest 'General enquiry, bad data' => sub { - $mech->get_ok('/waste/uprn/1000000002/enquiry'); - is $mech->uri->path, '/waste/uprn/1000000002'; - $mech->get_ok('/waste/uprn/1000000002/enquiry?category=Bad'); - is $mech->uri->path, '/waste/uprn/1000000002'; - $mech->get_ok('/waste/uprn/1000000002/enquiry?service=1'); - is $mech->uri->path, '/waste/uprn/1000000002'; + $mech->get_ok('/waste/12345/enquiry'); + is $mech->uri->path, '/waste/12345'; + $mech->get_ok('/waste/12345/enquiry?category=Bad'); + is $mech->uri->path, '/waste/12345'; + $mech->get_ok('/waste/12345/enquiry?service=1'); + is $mech->uri->path, '/waste/12345'; }; subtest 'Checking calendar' => sub { $mech->follow_link_ok({ text => 'Add to your calendar (.ics file)' }); @@ -165,7 +166,7 @@ FixMyStreet::override_config { }; subtest 'General enquiry, on behalf of someone else' => sub { $mech->log_in_ok($staff_user->email); - $mech->get_ok('/waste/uprn/1000000002/enquiry?category=General+enquiry&service_id=537'); + $mech->get_ok('/waste/12345/enquiry?category=General+enquiry&service_id=537'); $mech->submit_form_ok({ with_fields => { extra_Notes => 'Some notes' } }); $mech->submit_form_ok({ with_fields => { name => "Test McTest", email => $user->email } }); $mech->content_contains('Some notes'); @@ -195,8 +196,8 @@ FixMyStreet::override_config { $integ->mock(call => sub { return SOAP::Result->new(result => { PointInfo => [ - { Description => '1 Example Street', SharedRef => { Value => { anyType => 1000000001 } } }, - { Description => '2 Example Street', SharedRef => { Value => { anyType => 1000000002 } } }, + { Description => '1 Example Street', Id => '11345', SharedRef => { Value => { anyType => 1000000001 } } }, + { Description => '2 Example Street', Id => '12345', SharedRef => { Value => { anyType => 1000000002 } } }, ], }); }); -- cgit v1.2.3