blob: 00070ed81d224b619449c2628103ff870166b48e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
use strict;
use warnings;
use Test::More;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
$mech->get_ok('/my');
is $mech->uri->path, '/auth', "got sent to the sign in page";
$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";
$mech->content_contains('Test Title');
$mech->content_lacks('Another Title');
done_testing();
END {
$mech->delete_user($user);
$mech->delete_user($other_user);
}
|