From 430f17de7b4af94e52152bf11a30bd423a7a1c34 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 7 Apr 2017 14:07:08 +0100 Subject: Allow comma-separated contact emails in the admin The report-sending code has allowed multiple emails for a long time, but the admin wouldn't allow you to enter multiple emails for each contact. Fixes mysociety/FixMyStreet-Commercial#835 --- t/app/controller/admin.t | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 't/app/controller/admin.t') diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 2fdd8b74a..5f8abe5a6 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -206,7 +206,7 @@ subtest 'check contact creation' => sub { subtest 'check contact editing' => sub { $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); - $mech->submit_form_ok( { with_fields => { + $mech->submit_form_ok( { with_fields => { email => 'test2@example.com', note => 'test2 note', non_public => undef, @@ -218,7 +218,18 @@ subtest 'check contact editing' => sub { $mech->content_contains( 'Private: No' ); $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); - $mech->submit_form_ok( { with_fields => { + $mech->submit_form_ok( { with_fields => { + email => 'test2@example.com, test3@example.com', + note => 'test3 note', + } } ); + + $mech->content_contains( 'test2@example.com,test3@example.com' ); + + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->content_contains( 'test2@example.com,test3@example.com' ); + + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { email => 'test2@example.com', note => 'test2 note', non_public => 'on', -- cgit v1.2.3