');
$mech->content_lacks('Please please ring');
$mech->submit_form_ok({ with_fields => { dangerous => 'yes' } });
$mech->content_contains('
');
$mech->content_contains('Please please ring');
};
};
subtest "Staff users still see disable form categories" => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => 'borsetshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->log_in_ok($staff_user->email);
$contact2->push_extra_fields({ description => 'Please ring us!', code => 'ring', variable => 'false', order => '0', disable_form => 'true' });
$contact2->update;
# Test new non-JS form disabling flow
$mech->get_ok('/report/new?latitude=51.496194&longitude=-2.603439');
$mech->submit_form_ok({ with_fields => { category => 'Graffiti Removal' } });
$mech->content_contains('
');
$mech->content_contains('Please ring us!');
};
};
subtest "Staff users disable form categories" => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->log_out_ok;
$mech->log_in_ok($ncc_staff_user->email);
$mech->get_ok('/report/new?latitude=52.236251&longitude=-0.892052');
$mech->submit_form_ok({ with_fields => {
category => 'Flooding', title => 'Title', detail => 'Detail',
} });
my $prob = $ncc_staff_user->problems->first;
ok $prob, 'problem created';
is $prob->title, "Title", 'Report title correct';
};
};
done_testing();