diff options
-rw-r--r-- | t/app/controller/index.t | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/t/app/controller/index.t b/t/app/controller/index.t index 86d5e2d8c..462b21064 100644 --- a/t/app/controller/index.t +++ b/t/app/controller/index.t @@ -57,18 +57,21 @@ subtest "does pc, (x,y), (e,n) or (lat,lon) go to /around" => sub { $mech->delete_problems_for_council( 2651 ); +my $problem_rs = FixMyStreet::App->model('DB::Problem'); +my $num = $problem_rs->count; + my @edinburgh_problems = $mech->create_problems_for_council(5, 2651, 'Front page'); is scalar @edinburgh_problems, 5, 'correct number of edinburgh problems created'; -$mech->get_ok('/'); +$mech->get_ok('/report/' . $edinburgh_problems[2]->id); $mech->content_contains('Front page Test 3 for 2651', 'problem to be marked non public visible'); -$mech->content_contains('5</big> reports recently', 'number of recent problems correct'); +is $problem_rs->count, $num+5; my $private = $edinburgh_problems[2]; ok $private->update( { non_public => 1 } ), 'problem marked non public'; -$mech->get_ok('/'); -$mech->content_lacks('Front page Test 3 for 2651', 'non public problem is not visible'); -$mech->content_contains('5</big> reports recently', 'non public problems listed in recent problems stats'); +ok $mech->get('/report/' . $edinburgh_problems[2]->id); +is $mech->res->code, 403, 'page forbidden'; +is $problem_rs->count, $num+5; done_testing(); |