diff options
Diffstat (limited to 't/app/controller/contact.t')
-rw-r--r-- | t/app/controller/contact.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t index 842f27dd5..c74aaa5ff 100644 --- a/t/app/controller/contact.t +++ b/t/app/controller/contact.t @@ -6,6 +6,16 @@ sub abuse_reports_only { 1; } 1; +package FixMyStreet::Cobrand::GeneralEnquiries; + +use base 'FixMyStreet::Cobrand::Default'; + +sub abuse_reports_only { 1 } + +sub setup_general_enquiries_stash { 1 } + +1; + package main; use FixMyStreet::TestMech; @@ -492,6 +502,27 @@ subtest 'check can limit contact to abuse reports' => sub { } }; +subtest 'check redirected to correct form for general enquiries cobrand' => sub { + FixMyStreet::override_config { + 'ALLOWED_COBRANDS' => [ 'generalenquiries' ], + }, sub { + $mech->get( '/contact' ); + is $mech->res->code, 200, "got 200 for final destination"; + is $mech->res->previous->code, 302, "got 302 for redirect"; + is $mech->uri->path, '/contact/enquiry'; + + $mech->get_ok( '/contact?id=' . $problem_main->id, 'can visit for abuse report' ); + + my $token = FixMyStreet::App->model("DB::Token")->create({ + scope => 'moderation', + data => { id => $problem_main->id } + }); + + $mech->get_ok( '/contact?m=' . $token->token, 'can visit for moderation complaint' ); + + } +}; + $problem_main->delete; done_testing(); |