aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/my.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/my.t')
-rw-r--r--t/app/controller/my.t19
1 files changed, 14 insertions, 5 deletions
diff --git a/t/app/controller/my.t b/t/app/controller/my.t
index da509e8ed..00070ed81 100644
--- a/t/app/controller/my.t
+++ b/t/app/controller/my.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 11;
+use Test::More;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
@@ -9,11 +9,20 @@ my $mech = FixMyStreet::TestMech->new;
$mech->get_ok('/my');
is $mech->uri->path, '/auth', "got sent to the sign in page";
-# sign in
+$mech->create_problems_for_body(1, 1234, 'Test Title');
+my $other_user = FixMyStreet::DB->resultset('User')->find_or_create({ email => 'another@example.com' });
+$mech->create_problems_for_body(1, 1234, 'Another Title', { user => $other_user });
+
my $user = $mech->log_in_ok( 'test@example.com' );
$mech->get_ok('/my');
-is $mech->uri->path, '/my', "stayed on '/my/' page";
+is $mech->uri->path, '/my', "stayed on '/my' page";
+
+$mech->content_contains('Test Title');
+$mech->content_lacks('Another Title');
-# cleanup
-$mech->delete_user( $user );
+done_testing();
+END {
+ $mech->delete_user($user);
+ $mech->delete_user($other_user);
+}