diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:18 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-30 14:12:18 +0100 |
commit | 9b40321e0b641c046dbd642ad600cce83fbba8a3 (patch) | |
tree | a49e0160a554fdad54bf9e813cb009049ba8a5cc /t/app/controller/admin | |
parent | 81f86542c4d306d89f9a3718154203b35583fee5 (diff) | |
parent | b36d053978ff90e2827c8c859f8c2b15af3b5ad1 (diff) |
Merge branch '2469-improve-admin-category-form'
Diffstat (limited to 't/app/controller/admin')
-rw-r--r-- | t/app/controller/admin/bodies.t | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index a07f19494..75f0f606f 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 @@ -230,7 +248,7 @@ FixMyStreet::override_config { }, sub { subtest 'group editing works' => sub { $mech->get_ok('/admin/body/' . $body->id); - $mech->content_contains( 'group</strong> is used for the top-level category' ); + $mech->content_contains('Parent categories'); $mech->submit_form_ok( { with_fields => { category => 'grouped category', @@ -247,7 +265,7 @@ FixMyStreet::override_config { subtest 'group can be unset' => sub { $mech->get_ok('/admin/body/' . $body->id); - $mech->content_contains( 'group</strong> is used for the top-level category' ); + $mech->content_contains('Parent categories'); $mech->submit_form_ok( { with_fields => { category => 'grouped category', @@ -270,12 +288,11 @@ FixMyStreet::override_config { BASE_URL => 'http://www.example.org', COBRAND_FEATURES => { category_groups => { default => 1 }, - multiple_category_groups => { default => 1 }, } }, sub { subtest 'multi group editing works' => sub { $mech->get_ok('/admin/body/' . $body->id); - $mech->content_contains( 'group</strong> is used for the top-level category' ); + $mech->content_contains('Parent categories'); # have to do this as a post as adding a second group requires # javascript |