-
-
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.
Merge remote-tracking branch 'origin/improve-all-reports-in-places'
- Loading branch information
Showing
12 changed files
with
213 additions
and
25 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
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 |
---|---|---|
|
@@ -20,6 +20,8 @@ $resolver->mock('address', sub { $_[1] }); | |
my $body = $mech->create_body_ok( 2514, 'Birmingham', {}, { cobrand => 'birmingham' } ); | ||
$mech->create_body_ok( 2482, 'Bromley', {}, { cobrand => 'bromley' }); | ||
|
||
$mech->create_body_ok(2482, 'Bike provider'); | ||
|
||
my $contact = $mech->create_contact_ok( | ||
body_id => $body->id, | ||
category => 'Traffic lights', | ||
|
@@ -40,6 +42,11 @@ FixMyStreet::override_config { | |
MAPIT_URL => 'http://mapit.uk/', | ||
TEST_DASHBOARD_DATA => $data, | ||
ALLOWED_COBRANDS => [ 'fixmystreet', 'birmingham' ], | ||
COBRAND_FEATURES => { | ||
categories_restriction_bodies => { | ||
tfl => [ 'Bike provider' ], | ||
} | ||
}, | ||
}, sub { | ||
ok $mech->host('www.fixmystreet.com'); | ||
|
||
|
@@ -122,6 +129,14 @@ FixMyStreet::override_config { | |
$mech->content_lacks('Where we send Birmingham'); | ||
}; | ||
|
||
subtest 'Check All Reports page for bike bodies' => sub { | ||
$mech->get_ok('/reports/Bike+provider'); | ||
$mech->content_contains('Bromley'); | ||
$mech->content_lacks('Trowbridge'); | ||
$mech->get_ok('/reports/Bike+provider/Bromley'); | ||
is $mech->uri->path, '/reports/Bike+provider/Bromley'; | ||
}; | ||
|
||
subtest 'check average fix time respects cobrand cut-off date and non-standard reports' => sub { | ||
$mech->log_in_ok('[email protected]'); | ||
my $user = FixMyStreet::DB->resultset('User')->find_or_create({ email => '[email protected]' }); | ||
|
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 |
---|---|---|
|
@@ -13,6 +13,12 @@ use open ':std', ':encoding(UTF-8)'; | |
|
||
my $nh = $mech->create_body_ok(164186, 'Northamptonshire Highways', { | ||
send_method => 'Open311', api_key => 'key', 'endpoint' => 'e', 'jurisdiction' => 'j', send_comments => 1, can_be_devolved => 1 }, { cobrand => 'northamptonshire' }); | ||
# Associate body with North Northamptonshire area | ||
FixMyStreet::DB->resultset('BodyArea')->find_or_create({ | ||
area_id => 164185, | ||
body_id => $nh->id, | ||
}); | ||
|
||
my $wnc = $mech->create_body_ok(164186, 'West Northamptonshire Council'); | ||
my $po = $mech->create_body_ok(164186, 'Northamptonshire Police'); | ||
|
||
|
@@ -405,13 +411,6 @@ subtest 'Old report cutoff' => sub { | |
is $cobrand->should_skip_sending_update($update2), 0; | ||
}; | ||
|
||
# Associate body with North Northamptonshire area | ||
# (It's associated with West when it's created at the top of this file) | ||
FixMyStreet::DB->resultset('BodyArea')->find_or_create({ | ||
area_id => 164185, | ||
body_id => $nh->id, | ||
}); | ||
|
||
subtest 'Dashboard wards contains North and West wards' => sub { | ||
my $staffuser = $mech->create_user_ok('[email protected]', name => 'Council User', | ||
from_body => $nh, password => 'password'); | ||
|
@@ -426,4 +425,21 @@ subtest 'Dashboard wards contains North and West wards' => sub { | |
$mech->content_contains('Sulgrave'); | ||
}; | ||
|
||
FixMyStreet::override_config { | ||
MAPIT_URL => 'http://mapit.uk/', | ||
ALLOWED_COBRANDS => 'fixmystreet', | ||
}, sub { | ||
subtest 'All reports page working' => sub { | ||
$mech->get_ok("/reports/Northamptonshire+Highways"); | ||
$mech->content_contains('Sulgrave'); | ||
$mech->content_contains('Weston'); | ||
$mech->get_ok("/reports/Northamptonshire+Highways/Weston+By+Welland"); | ||
$mech->content_lacks('Sulgrave'); | ||
$mech->content_contains('Weston'); | ||
$mech->get_ok("/reports/Northamptonshire+Highways/Sulgrave"); | ||
$mech->content_contains('Sulgrave'); | ||
$mech->content_lacks('Weston'); | ||
}; | ||
}; | ||
|
||
done_testing(); |
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