diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-25 18:11:54 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 11:46:56 +0100 |
commit | b36d053978ff90e2827c8c859f8c2b15af3b5ad1 (patch) | |
tree | 3f141cbf061fd052d16dfbbb36e9edf71aa3592a /t/app/controller | |
parent | 9439346af7941134fd4b98a115cd936947783f0a (diff) |
Add top disable-form field to admin category form.
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 adbb09293..c1072eb15 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -217,6 +217,24 @@ subtest 'check text output' => sub { $mech->content_lacks('<body'); }; +subtest 'disable form message editing' => sub { + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { + disable => 1, + disable_message => 'Please ring us!', + note => 'Adding emergency message', + } } ); + $mech->content_contains('Values updated'); + my $contact = $body->contacts->find({ category => 'test category' }); + is_deeply $contact->get_extra_fields, [{ + description => 'Please ring us!', + code => '_fms_disable_', + protected => 'true', + variable => 'false', + disable_form => 'true', + }], 'right message added'; +}; + }; # END of override wrap |