diff options
Diffstat (limited to 't/app/controller/report_display.t')
-rw-r--r-- | t/app/controller/report_display.t | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 24a62b958..f979cc4ed 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -64,13 +64,29 @@ subtest "test bad ids get dealt with (404)" => sub { } }; +subtest "change report to unconfirmed and check for 404 status" => sub { + ok $report->update( { state => 'unconfirmed' } ), 'unconfirm report'; + ok $mech->get("/report/$report_id"), "get '/report/$report_id'"; + is $mech->res->code, 404, "page not found"; + is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; + $mech->content_contains('Unknown problem ID'); + ok $report->update( { state => 'confirmed' } ), 'confirm report again'; +}; + +subtest "change report to hidden and check for 410 status" => sub { + ok $report->update( { state => 'hidden' } ), 'hide report'; + ok $mech->get("/report/$report_id"), "get '/report/$report_id'"; + is $mech->res->code, 410, "page gone"; + is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; + $mech->content_contains('That report has been removed from FixMyStreet.'); + ok $report->update( { state => 'confirmed' } ), 'confirm report again'; +}; + subtest "test a good report" => sub { $mech->get_ok("/report/$report_id"); is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; }; -fail "change report to hidden and check for 400 status"; - # tidy up $mech->delete_user('test@example.com'); done_testing(); |