aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-13 12:06:57 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-13 12:06:57 +0100
commit959acf33e06ea8ea3bae7fa89e800dfd8c45621e (patch)
tree0398c64f904a2befa07cac899c388f7a03c9fdd3 /t/app
parentacec961ab9961b69e43a7cc95616577021bbd47d (diff)
display problem and update information as appropriate
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/contact.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index 2ddc279bc..60e330776 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -11,4 +11,38 @@ $mech->get_ok( '/contact' );
$mech->title_like( qr/Contact Us/ );
$mech->content_contains( "We'd love to hear what you think about this site" );
+subtest 'check reporting a problem displays correctly' => sub {
+ my $user = FixMyStreet::App->model('DB::User')->find_or_create(
+ {
+ name => 'A User',
+ email => 'problem_report_rest@example.com'
+ }
+ );
+
+ my $problem = FixMyStreet::App->model('DB::Problem')->create(
+ {
+ title => 'Some problem or other',
+ detail => 'More detail on the problem',
+ postcode => 'EH99 1SP',
+ latitude => 0,
+ longitude => 0,
+ areas => 0,
+ used_map => 0,
+ name => 'Problem User',
+ anonymous => 0,
+ state => 'confirmed',
+ user => $user
+ }
+ );
+
+ ok $problem, 'succesfully create a problem';
+
+ $mech->get_ok( '/contact?id=' . $problem->id );
+ $mech->content_contains( 'reporting the following problem' );
+ $mech->content_contains( 'Some problem or other' );
+ $mech->content_contains( 'Reported by A User' );
+
+ $problem->delete;
+};
+
done_testing();