aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/waste.t27
-rw-r--r--t/cobrand/bromley.t20
2 files changed, 24 insertions, 23 deletions
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( '<a href="/waste/uprn/1000000002">See your bin collections</a>' );
+ $mech->content_contains( '<a href="/waste/12345">See your bin collections</a>' );
$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 &amp; 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 } } },
],
});
});
diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t
index 13f4f2308..561b5b283 100644
--- a/t/cobrand/bromley.t
+++ b/t/cobrand/bromley.t
@@ -270,7 +270,7 @@ FixMyStreet::override_config {
}, sub {
subtest 'test open enquiries' => sub {
set_fixed_time('2020-05-19T12:00:00Z'); # After sample food waste collection
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_like(qr/Mixed Recycling.*?Next collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 20th May\s+\(this collection has been adjusted/s);
$mech->follow_link_ok({ text => 'Report a problem with a food waste collection' });
$mech->content_contains('Waste spillage');
@@ -280,7 +280,7 @@ FixMyStreet::override_config {
subtest 'test crew reported issue' => sub {
set_fixed_time('2020-05-21T12:00:00Z'); # After sample container mix
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_like(qr/Mixed Recycling.*?Last collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 20th May\s+\(this collection has been adjusted/s);
$mech->content_contains('A missed collection cannot be reported, please see the last collection status above.');
$mech->content_lacks('Report a mixed recycling ');
@@ -289,14 +289,14 @@ FixMyStreet::override_config {
subtest 'test reporting before/after completion' => sub {
set_fixed_time('2020-05-27T11:00:00Z');
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_like(qr/Refuse collection.*?Last collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 27th May\s+\(completed at 10:00am\)\s*<p>\s*Wrong Bin Out/s);
$mech->content_like(qr/Paper &amp; Cardboard.*?Next collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 27th May\s+\(in progress\)/s);
$mech->follow_link_ok({ text => 'Report a problem with a paper & cardboard collection' });
$mech->content_lacks('Waste spillage');
set_fixed_time('2020-05-27T19:00:00Z');
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_like(qr/Refuse collection.*?Last collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 27th May\s+\(completed at 10:00am\)\s*<p>\s*Wrong Bin Out/s);
$mech->content_like(qr/Paper &amp; Cardboard.*?Last collection<\/dt>\s*<dd[^>]*>\s*Wednesday, 27th May\s*<\/dd>/s);
$mech->follow_link_ok({ text => 'Report a problem with a paper & cardboard collection' });
@@ -317,19 +317,19 @@ FixMyStreet::override_config {
};
subtest 'test reporting before/after completion' => sub {
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_contains('(completed at 10:00am)');
$mech->content_contains('We could not collect your waste as it was not correctly presented.');
$mech->content_lacks('Report a paper &amp; cardboard collection');
$mech->content_contains('Report a refuse collection');
set_fixed_time('2020-05-28T12:00:00Z');
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_contains('Report a refuse collection');
set_fixed_time('2020-05-29T12:00:00Z');
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_contains('Report a refuse collection');
set_fixed_time('2020-05-30T12:00:00Z');
- $mech->get_ok('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
$mech->content_lacks('Report a refuse collection');
restore_time();
};
@@ -346,8 +346,8 @@ subtest 'test waste max-per-day' => sub {
SKIP: {
skip( "No memcached", 2 ) unless Memcached::increment('bromley-test');
Memcached::delete("bromley-test");
- $mech->get_ok('/waste/uprn/12345');
- $mech->get('/waste/uprn/12345');
+ $mech->get_ok('/waste/12345');
+ $mech->get('/waste/12345');
is $mech->res->code, 403, 'Now forbidden';
}
};