-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bexley] Add form for properties with no collections
- Loading branch information
1 parent
616c0e5
commit 036cc36
Showing
7 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,7 @@ $whitespace_mock->mock( | |
} | ||
); | ||
my $comment_user = $mech->create_user_ok('comment'); | ||
my $user = $mech->create_user_ok('[email protected]', name => 'Test User', email_verified => 1); | ||
my $body = $mech->create_body_ok( | ||
2494, | ||
'London Borough of Bexley', | ||
|
@@ -185,6 +186,33 @@ $contact->set_extra_fields( | |
|
||
$contact->update; | ||
|
||
my $contact2 = $mech->create_contact_ok( | ||
body => $body, | ||
category => 'Missed collection enquiry', | ||
email => '[email protected]', | ||
extra => { type => 'waste' }, | ||
group => ['Waste'], | ||
); | ||
$contact2->set_extra_fields( | ||
{ | ||
code => "waste_types", | ||
description => "Which collections would you like to report as missed?", | ||
datatype => "multivaluelist", | ||
required => "true", | ||
values => [ | ||
map { { key => $_, name => $_ } } ( | ||
"Refuse", | ||
"Paper/card recycling", | ||
"Plastics/glass recycling", | ||
"Food waste", | ||
"Garden waste", | ||
"Mixed recycling" | ||
) | ||
], | ||
} | ||
); | ||
$contact2->update; | ||
|
||
my ($existing_missed_collection_report1) = $mech->create_problems_for_body(1, $body->id, 'Report missed collection', { | ||
external_id => "Whitespace-4", | ||
}); | ||
|
@@ -1006,6 +1034,23 @@ FixMyStreet::override_config { | |
set_fixed_time('2024-03-31T02:00:00'); # March 31st, 02:00 BST | ||
}; | ||
|
||
subtest 'Enquiry form for properties with no collections' => sub { | ||
$mech->get_ok('/waste/10006'); | ||
$mech->content_contains('/waste/10006/enquiry?template=no-collections', 'link to no collections form present'); | ||
$mech->get_ok('/waste/10006/enquiry?template=no-collections'); | ||
$mech->submit_form_ok( { with_fields => { category => 'Missed collection enquiry' } } ); | ||
$mech->content_contains('Which collections would you like to report as missed?'); | ||
$mech->content_contains('Paper/card recycling'); | ||
$mech->submit_form_ok( { with_fields => { extra_waste_types => 'Refuse' } } ); | ||
$mech->content_contains('Full name'); | ||
$mech->submit_form_ok( { with_fields => { name => 'Test User', email => '[email protected]' } } ); | ||
$mech->content_contains('Refuse'); | ||
$mech->content_contains('Test User'); | ||
$mech->content_contains('[email protected]'); | ||
$mech->content_contains('Please review the information you’ve provided before you submit your enquiry.'); | ||
$mech->submit_form_ok( { with_fields => { submit => 'Submit' } } ); | ||
$mech->content_contains('Nearly done! Now check your email'); | ||
}; | ||
}; | ||
|
||
FixMyStreet::override_config { | ||
|
@@ -1307,6 +1352,15 @@ sub _site_info { | |
SiteLongitude => 0.181108, | ||
}, | ||
}, | ||
10006 => { | ||
AccountSiteID => 6, | ||
AccountSiteUPRN => 10006, | ||
Site => { | ||
SiteShortAddress => ', 6, THE AVENUE, DA1 3LD', | ||
SiteLatitude => 51.466707, | ||
SiteLongitude => 0.181108, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
|
@@ -1466,6 +1520,7 @@ sub _site_collections { | |
RoundSchedule => 'N/A', | ||
}, | ||
], | ||
10006 => [], | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>There are currently no collections at this property. Please <a href="[% c.uri_for_action('waste/enquiry', [ property.id ]) %]?template=no-collections">use this form to report a missed collection</a>.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[% PROCESS waste/enquiry.html | ||
title = 'No collections' | ||
field_label = 'Are you trying to report a missed collection from a business, school, community group or place of worship?', | ||
field_options = [ | ||
{ label = 'Yes', value = 'Business or organisation missed collection enquiry' }, | ||
{ label = 'No', value = 'Missed collection enquiry'}, | ||
]; | ||
%] |