aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-10-25 13:49:11 +0100
committerMatthew Somerville <matthew@mysociety.org>2013-10-25 13:49:11 +0100
commit5b1520f738a362b5c6a0def5b5d322a728df3951 (patch)
tree93a10ae5ea8b0f91f91ea54233731c78157161ca /t/app
parent604d306f4fc0f0024fc9a493f391413811dfbb3f (diff)
Set confirmed timestamp on any admin unconfirmed state change.
This fixes #527.
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/admin.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 80ea839da..85f4572fc 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -562,7 +562,7 @@ foreach my $test (
$report->discard_changes;
if ( $report->state eq 'confirmed' ) {
- $mech->content_contains( 'type="submit" name="resend"', 'no resend button' );
+ $mech->content_contains( 'type="submit" name="resend"', 'resend button' );
} else {
$mech->content_lacks( 'type="submit" name="resend"', 'no resend button' );
}
@@ -1212,6 +1212,15 @@ for my $test (
};
}
+subtest "Test setting a report from unconfirmed to something else doesn't cause a front end error" => sub {
+ $report->update( { confirmed => undef, state => 'unconfirmed', non_public => 0 } );
+ $mech->get_ok("/admin/report_edit/$report_id");
+ $mech->submit_form_ok( { with_fields => { state => 'investigating' } } );
+ $report->discard_changes;
+ ok( $report->confirmed, 'report has a confirmed timestamp' );
+ $mech->get_ok("/report/$report_id");
+};
+
$mech->delete_user( $user );
$mech->delete_user( $user2 );
$mech->delete_user( $user3 );