diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-10 17:31:57 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-10 17:54:12 +0100 |
commit | e789a07dcb1936e3b0d7a23583aaf3d05e3d80f5 (patch) | |
tree | fd433cd0a2704eff202f464b95a0f1e190c99154 /t/app | |
parent | 4faf6b08b07bf450d87db10df786f2b7ff8a802c (diff) |
Direct report moderated emails correctly.
Diffstat (limited to 't/app')
-rw-r--r-- | t/app/controller/moderate.t | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t index e3e8bf2cf..52201c63b 100644 --- a/t/app/controller/moderate.t +++ b/t/app/controller/moderate.t @@ -19,6 +19,8 @@ my $user = $mech->create_user_ok('test-moderation@example.com', name => 'Test Us $user->user_body_permissions->delete_all; $user->discard_changes; +my $user2 = $mech->create_user_ok('test-moderation2@example.com', name => 'Test User 2'); + sub create_report { FixMyStreet::App->model('DB::Problem')->create( { @@ -29,7 +31,7 @@ sub create_report { title => 'Good bad good', detail => 'Good bad bad bad good bad', used_map => 't', - name => 'Test User', + name => 'Test User 2', anonymous => 'f', state => 'confirmed', confirmed => $dt->ymd . ' ' . $dt->hms, @@ -40,7 +42,7 @@ sub create_report { send_questionnaire => 't', latitude => '51.4129', longitude => '0.007831', - user_id => $user->id, + user_id => $user2->id, photo => $mech->get_photo_data, }); } @@ -169,7 +171,9 @@ subtest 'Problem moderation' => sub { $report->discard_changes; is $report->state, 'hidden', 'Is hidden'; - my $url = $mech->get_link_from_email; + my $email = $mech->get_email; + is $email->header('To'), '"Test User 2" <test-moderation2@example.com>', 'Sent to correct email'; + my $url = $mech->get_link_from_email($email); ok $url, "extracted complain url '$url'"; $mech->get_ok($url); @@ -210,8 +214,8 @@ subtest 'Problem 2' => sub { sub create_update { $report->comments->create({ - user => $user, - name => 'Test User', + user => $user2, + name => 'Test User 2', anonymous => 'f', photo => $mech->get_photo_data, text => 'update good good bad good', |