diff options
Diffstat (limited to 't/app/controller/report_new_mobile.t')
-rw-r--r-- | t/app/controller/report_new_mobile.t | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/t/app/controller/report_new_mobile.t b/t/app/controller/report_new_mobile.t index 296007ce3..def140a72 100644 --- a/t/app/controller/report_new_mobile.t +++ b/t/app/controller/report_new_mobile.t @@ -15,21 +15,20 @@ subtest "Check signed up for alert when logged in" => sub { MAPIT_URL => 'http://mapit.zurich', MAPIT_TYPES => [ 'O08' ], }, sub { - $mech->log_in_ok('user@example.org'); + my $user = $mech->log_in_ok('user@example.org'); $mech->post_ok( '/report/new/mobile', { service => 'iPhone', title => 'Title', detail => 'Problem detail', lat => 47.381817, lon => 8.529156, - email => 'user@example.org', + email => $user->email, pc => '', name => 'Name', }); my $res = $mech->response; ok $res->header('Content-Type') =~ m{^application/json\b}, 'response should be json'; - my $user = FixMyStreet::DB->resultset('User')->search({ email => 'user@example.org' })->first; my $a = FixMyStreet::DB->resultset('Alert')->search({ user_id => $user->id })->first; isnt $a, undef, 'User is signed up for alert'; }; |