diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-05 08:58:11 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-05 09:35:32 +0100 |
commit | 0d7d04f3a2e893ffa15c5700c83f9d4f6b83f06f (patch) | |
tree | 98abb67fa60cf489fc43f242348cd3100fc7851c /t/app/controller | |
parent | cebc75590be13058465818780eb9d69a2b11ee48 (diff) |
Allow contact send method to be unset always.
If a body was set to Open311, and a contact set to Email, it was
impossible to unset the contact's send method and set an Open311
code, because it would always demaned a valid email address.
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/admin/bodies.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index db53b7cda..6fb13f0ff 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -182,6 +182,7 @@ subtest 'check open311 configuring' => sub { send_comments => 0, send_method => 'Open311', fetch_all_problems => 0, + can_be_devolved => 1, # for next test } } ); @@ -192,6 +193,23 @@ subtest 'check open311 configuring' => sub { ok !$conf->get_extra_metadata('fetch_all_problems'), 'fetch all problems unset'; }; +subtest 'check open311 devolved editing' => sub { + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { + send_method => 'Email', + email => 'testing@example.org', + note => 'Updating contact to email', + } } ); + $mech->content_contains('Values updated'); + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { + send_method => '', + email => 'open311-code', + note => 'Removing email send method', + } } ); + $mech->content_contains('Values updated'); +}; + subtest 'check text output' => sub { $mech->get_ok('/admin/body/' . $body->id . '?text=1'); is $mech->content_type, 'text/plain'; |