aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App.pm2
-rw-r--r--t/app/controller/admin.t26
2 files changed, 27 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 18f086868..29e38a24e 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -377,7 +377,7 @@ sub uri_for_email {
my $c = shift;
my @args = @_;
- my $normal_uri = $c->uri_for(@_);
+ my $normal_uri = $c->uri_for(@_)->absolute;
my $base = $c->cobrand->base_url_with_lang( 1 );
my $email_uri = $base . $normal_uri->path_query;
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 );