-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Peterborough] Fixes checking bodyclass
bodyclass can be more than one word and this has an impact on testing for bodyclass in templates. Now when testing see if the string contains 'waste' rather than is exactly 'waste' mysociety/societyworks#4012
- Loading branch information
1 parent
4b8be93
commit f3eb247
Showing
4 changed files
with
22 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ my $user2 = $mech->create_user_ok('[email protected]', name => 'Very Normal User | |
my $staff = $mech->create_user_ok('[email protected]', name => 'Staff User', from_body => $body->id); | ||
$staff->user_body_permissions->create({ body => $body, permission_type => 'contribute_as_another_user' }); | ||
$staff->user_body_permissions->create({ body => $body, permission_type => 'report_mark_private' }); | ||
$staff->user_body_permissions->create({ body => $body, permission_type => 'planned_reports' }); | ||
my $super = $mech->create_user_ok('[email protected]', name => 'Super User', is_superuser => 1); | ||
|
||
my $bromley = $mech->create_body_ok(2482, 'Bromley Council', {}, { cobrand => 'bromley' }); | ||
|
@@ -69,6 +70,23 @@ FixMyStreet::override_config { | |
}, | ||
}, sub { | ||
my ($b, $jobs_fsd_get) = shared_bartec_mocks(); | ||
|
||
subtest 'Footer is shown' => sub { | ||
$mech->get_ok('/waste'); | ||
$mech->content_contains('https://www.societyworks.org/services/waste/">SocietyWorks') | ||
}; | ||
|
||
subtest 'Shortlist link not on WasteWorks pages' => sub { | ||
$mech->get_ok('/'); | ||
$mech->content_lacks('Shortlist</a>'); | ||
$mech->log_in_ok($staff->email); | ||
$mech->get_ok('/'); | ||
$mech->content_contains('Shortlist</a>'); | ||
$mech->get_ok('/waste'); | ||
$mech->content_lacks('Shortlist</a>'); | ||
$mech->log_out_ok; | ||
}; | ||
|
||
subtest 'Missing address lookup' => sub { | ||
$mech->get_ok('/waste'); | ||
$mech->submit_form_ok({ with_fields => { postcode => 'PE1 3NA' } }); | ||
|
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,2 +1,2 @@ | ||
<a href="https://www.peterborough.gov.uk/" id="site-logo">Peterborough City Council</a> | ||
<a href="/[%~ IF bodyclass == 'waste' ~%]waste/[%~ END ~%]" id="report-cta" title="[%- loc('Report a problem') -%]">[%- loc('Report') -%]</a> | ||
<a href="/[%~ IF bodyclass.match('waste') ~%]waste/[%~ END ~%]" id="report-cta" title="[%- loc('Report a problem') -%]">[%- loc('Report') -%]</a> |
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