-
-
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.
Merge branch 'brent-closed-age' into commercial-staging
- Loading branch information
Showing
11 changed files
with
148 additions
and
31 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
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
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 |
---|---|---|
|
@@ -15,6 +15,9 @@ $mech->create_contact_ok(body_id => $surrey->id, category => 'Potholes', email = | |
latitude => 51.293415, longitude => -0.441269, areas => '2242', | ||
}); | ||
|
||
my $guildford = $mech->create_body_ok(2452, 'Guildford Borough Council'); | ||
$mech->create_contact_ok(body_id => $guildford->id, category => 'Flytipping', email => '[email protected]'); | ||
|
||
my $UPLOAD_DIR = tempdir( CLEANUP => 1 ); | ||
FixMyStreet::override_config { | ||
ALLOWED_COBRANDS => [ 'surrey' ], | ||
|
@@ -63,7 +66,32 @@ FixMyStreet::override_config { | |
$mech->get_ok("/dashboard?export=1"); | ||
$mech->content_contains('website,surrey,,2', 'CSV Subscriber number is 2 from pre-generated csv'); | ||
$mech->log_out_ok; | ||
} | ||
}; | ||
|
||
subtest 'Old reports are not shown on Surrey cobrand' => sub { | ||
note 'A newly created report is shown on Surrey cobrand'; | ||
my $json = $mech->get_ok_json('/around?ajax=1&bbox=-0.45869262976076,51.28481314324,-0.42367370886232,51.302390882532'); | ||
is_deeply($json->{pins}, [ | ||
[ "51.293415", "-0.441269", "yellow", $report->id, $report->title, "", 'false' ], | ||
], 'Problem is initially included in Surrey cobrand'); | ||
|
||
note 'Making the report predate the cut-off excludes it from Surrey cobrand'; | ||
my $dt = DateTime->new(year => 2024, month => 9, day => 1, hour => 12); | ||
$report->update({ | ||
created => $dt, | ||
confirmed => $dt, | ||
}); | ||
$json = $mech->get_ok_json('/around?ajax=1&bbox=-0.45869262976076,51.28481314324,-0.42367370886232,51.302390882532'); | ||
is_deeply($json->{pins}, [], 'Problem is now excluded from Surrey cobrand'); | ||
|
||
note 'Borough reports are excluded from Surrey cobrand if old enough too.'; | ||
$report->update({ | ||
bodies_str => $guildford->id, | ||
category => 'Flytipping', | ||
}); | ||
$json = $mech->get_ok_json('/around?ajax=1&bbox=-0.45869262976076,51.28481314324,-0.42367370886232,51.302390882532'); | ||
is_deeply($json->{pins}, [], 'Borough problem is excluded from Surrey cobrand'); | ||
}; | ||
}; | ||
|
||
|
||
|
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 |
---|---|---|
@@ -1,4 +1 @@ | ||
[% PROCESS 'footer_extra_js_base.html' highways=1 validation=1 %] | ||
|
||
<script type="text/javascript" src=https://feedback.happy-or-not.com/v1/bootloader/5D00DED5BC398A41C871E62A08F7CAC0/bootloaderjs/?lang=fi-FI&init=false></script> | ||
<script type="text/javascript" nonce="[% csp_nonce %]"> window.HappyOrNot && window.HappyOrNot.init({ token: "5D00DED5BC398A41C871E62A08F7CAC0", embedTo: document.getElementById('happy-or-not-smiley-digital-embed') }); </script> |
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