aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/dashboard.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-01-16 11:47:20 +0000
committerStruan Donald <struan@exo.org.uk>2013-01-16 11:47:20 +0000
commit682db36dca4db6c0682deeb4fb704e8cf222e38c (patch)
tree5811b7e2288f48b0bc814f7f505e19cb705294d9 /t/app/controller/dashboard.t
parent257b658e49da3665a426f1c98d9760b0d53b8d3d (diff)
parent3c4c0ec2f55d82502169d2313745920850efdc99 (diff)
Merge branch 'bromley-new-statuses'
Conflicts: bin/send-comments conf/crontab.ugly db/schema.sql perllib/FixMyStreet/App/Controller/Admin.pm perllib/FixMyStreet/DB/Result/Open311conf.pm perllib/FixMyStreet/DB/ResultSet/Problem.pm perllib/Open311.pm t/app/controller/report_updates.t t/open311.t templates/web/default/report/display.html templates/web/default/report/updates.html templates/web/fixmystreet/report/display.html
Diffstat (limited to 't/app/controller/dashboard.t')
-rw-r--r--t/app/controller/dashboard.t54
1 files changed, 42 insertions, 12 deletions
diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t
index 47d10ff5c..25e144464 100644
--- a/t/app/controller/dashboard.t
+++ b/t/app/controller/dashboard.t
@@ -78,7 +78,7 @@ my $categories = scraper {
process "tr[id=fixed_user] > td", 'user[]' => 'TEXT',
process "tr[id=total_fixed] > td", 'total_fixed[]' => 'TEXT',
process "tr[id=in_progress] > td", 'in_progress[]' => 'TEXT',
- process "tr[id=planned] > td", 'planned[]' => 'TEXT',
+ process "tr[id=action_scheduled] > td", 'action_scheduled[]' => 'TEXT',
process "tr[id=investigating] > td", 'investigating[]' => 'TEXT',
process "tr[id=marked] > td", 'marked[]' => 'TEXT',
process "tr[id=avg_marked] > td", 'avg_marked[]' => 'TEXT',
@@ -212,10 +212,10 @@ foreach my $test (
}
},
{
- desc => 'marked as planned today',
+ desc => 'marked as action scheduled today',
confirm_dt => DateTime->now->subtract( days => 1 ),
mark_dt => DateTime->now,
- state => 'planned',
+ state => 'action scheduled',
counts => {
totals => $is_monday ? [ 0,5,5,5] : [5,5,5,5],
user => [1,1,1,1],
@@ -224,15 +224,15 @@ foreach my $test (
avg_marked => [1,1,1,1],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [1,1,1,1],
+ action_scheduled => [1,1,1,1],
marked => [3,3,3,3]
}
},
{
- desc => 'marked as planned today, confirmed a week ago',
+ desc => 'marked as action scheduled today, confirmed a week ago',
confirm_dt => DateTime->now->subtract( days => 8 ),
mark_dt => DateTime->now,
- state => 'planned',
+ state => 'action scheduled',
counts => {
totals => $is_monday ? [0,5,6,6] : [5,5,6,6],
user => [1,1,1,1],
@@ -241,7 +241,7 @@ foreach my $test (
avg_marked => [3,3,3,3],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [2,2,2,2],
+ action_scheduled => [2,2,2,2],
marked => [4,4,4,4]
}
},
@@ -259,7 +259,7 @@ foreach my $test (
avg_marked => [3,3,3,3],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [2,2,2,2],
+ action_scheduled => [2,2,2,2],
marked => [4,4,4,4]
}
},
@@ -277,7 +277,7 @@ foreach my $test (
avg_marked => [3,3,3,3],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [2,2,2,2],
+ action_scheduled => [2,2,2,2],
marked => [4,4,4,4]
}
},
@@ -295,7 +295,7 @@ foreach my $test (
avg_marked => [3,3,3,3],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [2,2,2,2],
+ action_scheduled => [2,2,2,2],
marked => [4,4,4,4]
}
},
@@ -313,11 +313,30 @@ foreach my $test (
avg_marked => [2,2,2,2],
investigating => [1,1,1,1],
in_progress => [1,1,1,1],
- planned => [2,2,2,2],
+ action_scheduled => [2,2,2,2],
closed => [1,1,1,1],
marked => [5,5,5,5]
}
},
+ {
+ desc => 'marked as planned',
+ confirm_dt => DateTime->now->subtract( days => 1 ),
+ mark_dt => DateTime->now,
+ state => 'planned',
+ counts => {
+ totals => $is_monday ? [0,7,10,11] : [7,7,10,11],
+ user => [1,1,1,2],
+ council => [2,2,3,3],
+ total_fixed => [3,3,4,5],
+ avg_fixed => [5,5,7,7],
+ avg_marked => [2,2,2,2],
+ investigating => [1,1,1,1],
+ in_progress => [1,1,1,1],
+ action_scheduled => [3,3,3,3],
+ closed => [1,1,1,1],
+ marked => [6,6,6,6]
+ }
+ },
) {
subtest $test->{desc} => sub {
make_problem(
@@ -528,6 +547,17 @@ for my $test (
report_counts_after => [1,0,0],
},
{
+ desc => 'planned counted as action scheduled',
+ p1 => {
+ state => 'planned',
+ conf_dt => DateTime->now(),
+ category => 'Potholes',
+ },
+ state => 'action scheduled',
+ report_counts => [3,0,0],
+ report_counts_after => [1,0,0],
+ },
+ {
desc => 'All fixed states count as fixed',
p1 => {
state => 'fixed - council',
@@ -540,7 +570,7 @@ for my $test (
category => 'Potholes',
},
state => 'fixed',
- report_counts => [4,0,0],
+ report_counts => [5,0,0],
report_counts_after => [3,0,0],
},
) {