-
-
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.
[Lincolnshire] Add staff role to CSV export.
Extends the dashboard CSV export to include additional columns for staff roles when a report is contributed by a staff member.
- Loading branch information
1 parent
b2cca58
commit ee79433
Showing
3 changed files
with
53 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -103,6 +103,32 @@ FixMyStreet::override_config { | |
|
||
$p->delete; | ||
}; | ||
|
||
subtest "Dashboard CSV export includes extra staff columns" => sub { | ||
my $csv_staff = $mech->create_user_ok( | ||
'[email protected]', | ||
name => 'CSV Staff', | ||
from_body => $body, | ||
); | ||
my $csv_role = FixMyStreet::DB->resultset("Role")->create({ | ||
body => $body, | ||
name => 'CSV Role', | ||
permissions => ['moderate', 'user_edit'], | ||
}); | ||
$csv_staff->add_to_roles($csv_role); | ||
|
||
my @csv_problems = $mech->create_problems_for_body( 1, $body->id, 'CSV Export Test Issue', { | ||
cobrand => 'lincolnshire', | ||
user => $csv_staff, | ||
extra => { contributed_by => $csv_staff->id }, | ||
}); | ||
|
||
$mech->log_in_ok($csv_staff->email); | ||
$mech->get_ok('/dashboard?export=1'); | ||
|
||
$mech->content_contains('"Staff Role"'); | ||
$mech->content_like(qr/CSV Role/, "CSV export includes staff role"); | ||
}; | ||
}; | ||
|
||
FixMyStreet::override_config { | ||
|