aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-09-03 17:49:47 +0100
committerStruan Donald <struan@exo.org.uk>2012-09-03 17:49:47 +0100
commit41e11f0968be098f47f82986f255e037087624bb (patch)
treecfdcce530fc1336791ccf9ed46704714b9ea43a6 /t
parent350d82c314aa46367d0aba2b18e5858c9c46a025 (diff)
tests for non public reports on around page
Diffstat (limited to 't')
-rw-r--r--t/app/controller/around.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index db03e00f4..0ef9c95cf 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -78,4 +78,29 @@ foreach my $test (
};
}
+subtest 'check non public reports are not displayed on around page' => sub {
+ my $params = {
+ postcode => 'EH99 1SP',
+ latitude => 55.9519637512,
+ longitude => -3.17492254484,
+ };
+ my @edinburgh_problems =
+ $mech->create_problems_for_council( 5, 2651, 'Around page', $params );
+
+ $mech->get_ok('/');
+ $mech->submit_form_ok( { with_fields => { pc => 'EH99 1SP' } },
+ "good location" );
+ $mech->content_contains( 'Around 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->submit_form_ok( { with_fields => { pc => 'EH99 1SP' } },
+ "good location" );
+ $mech->content_lacks( 'Around page Test 3 for 2651',
+ 'problem marked non public is not visible' );
+};
+
+
done_testing();