aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-09 16:20:35 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-09 16:20:35 +0100
commit450f8656ef9487bf73b7ae5710a0935b53f424b2 (patch)
treea98aba38d187a1817ccbef01156f5a3c2a1d6eb2 /t/app/controller/admin.t
parentcdb545f3400a1fd9b4ea544c65dfbdff4919b880 (diff)
search report tests
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r--t/app/controller/admin.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index a4b3f39dd..b6ffa9d83 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -413,6 +413,32 @@ subtest 'change email to new user' => sub {
$log_entries->delete;
+subtest 'report search' => sub {
+ my $update = FixMyStreet::App->model('DB::Comment')->create(
+ {
+ text => 'this is an update',
+ user => $report->user,
+ state => 'confirmed',
+ problem => $report,
+ mark_fixed => 0,
+ anonymous => 1,
+ }
+ );
+
+ $mech->get_ok('/admin/search_reports');
+ $mech->get_ok('/admin/search_reports?search=' . $report->id );
+
+ $mech->content_contains( $report->title );
+ my $r_id = $report->id;
+ $mech->content_like( qr{href="http://[^/]*[^.]/report/$r_id/">$r_id</a>} );
+
+ $mech->get_ok('/admin/search_reports?search=' . $report->user->email);
+
+ my $u_id = $update->id;
+ $mech->content_like( qr{href="http://[^/]*[^.]/report/$r_id/">$r_id</a>} );
+ $mech->content_like( qr{href="http://[^/]*[^.]/report/$r_id/#update_$u_id">$u_id</a>} );
+};
+
$mech->delete_user( $user );
$mech->delete_user( $user2 );
$mech->delete_user( $user3 );