diff options
author | Struan Donald <struan@exo.org.uk> | 2012-09-03 17:24:28 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-09-03 17:24:28 +0100 |
commit | 350d82c314aa46367d0aba2b18e5858c9c46a025 (patch) | |
tree | b1d589b467416fee5327ea0ed75906da49b656d1 /t/app/controller/index.t | |
parent | bef1a31660bd3fccdda72cf2ca670c207a7a54c2 (diff) |
move add and delete problem utility functions to test mech
add in non public problem tests for front page
Diffstat (limited to 't/app/controller/index.t')
-rw-r--r-- | t/app/controller/index.t | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/app/controller/index.t b/t/app/controller/index.t index bf9124ee0..52e8cbcd9 100644 --- a/t/app/controller/index.t +++ b/t/app/controller/index.t @@ -55,4 +55,18 @@ subtest "does pc, (x,y), (e,n) or (lat,lon) go to /around" => sub { } }; +$mech->delete_problems_for_council( 2651 ); + +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->content_contains('Front page Test 3 for 2651', 'problem to be marked non public visible'); + +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'); + done_testing(); |