aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/contact_enquiry.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /t/app/controller/contact_enquiry.t
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 't/app/controller/contact_enquiry.t')
-rw-r--r--t/app/controller/contact_enquiry.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/app/controller/contact_enquiry.t b/t/app/controller/contact_enquiry.t
index af249ec6c..f1b5b15cd 100644
--- a/t/app/controller/contact_enquiry.t
+++ b/t/app/controller/contact_enquiry.t
@@ -40,9 +40,18 @@ my $contact4 = $mech->create_contact_ok(
category => 'Carriageway Defect',
email => 'potholes@example.com',
);
+my $contact5 = $mech->create_contact_ok(
+ body_id => $body->id,
+ category => 'Other (disabled)',
+ email => 'other@example.com',
+);
$contact->update( { extra => { group => 'General Enquiries' } } );
$contact2->update( { extra => { group => 'General Enquiries' } } );
$contact3->update( { extra => { group => 'Other' } } );
+$contact5->update( { extra => { group => 'Other' } } );
+
+$contact5->push_extra_fields({ code => '_fms_disable_', 'disable_form' => 'true', description => 'form_disabled' });
+$contact5->update;
FixMyStreet::override_config { ALLOWED_COBRANDS => ['bromley'], }, sub {
subtest 'redirected to / if general enquiries not enabled' => sub {
@@ -60,6 +69,7 @@ FixMyStreet::override_config {
subtest 'Non-general enquiries category not shown' => sub {
$mech->get_ok( '/contact/enquiry' );
$mech->content_lacks('Carriageway Defect');
+ $mech->content_lacks('Other (disabled)');
$mech->content_contains('FOI Request');
};
@@ -70,7 +80,7 @@ FixMyStreet::override_config {
$mech->submit_form_ok( {
with_fields => {
name => 'Test User',
- username => 'testuser@example.org',
+ username_register => 'testuser@example.org',
category => 'Other',
detail => 'This is a general enquiry',
}
@@ -139,7 +149,7 @@ FixMyStreet::override_config {
$mech->submit_form_ok( {
with_fields => {
name => 'Simon Neil',
- username => $user->email,
+ username_register => $user->email,
category => 'General Enquiry',
detail => 'This is a general enquiry',
}
@@ -202,7 +212,7 @@ FixMyStreet::override_config {
submit_problem => 1,
token => $csrf,
name => 'Test User',
- username => 'testuser@example.org',
+ username_register => 'testuser@example.org',
category => 'Other',
detail => encode_utf8('This is a general enquiry‽'),
photo1 => [ $sample_jpeg, undef, Content_Type => 'image/jpeg' ],