diff options
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/contact.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t index 0e87eb4cc..c1039d15b 100644 --- a/t/app/controller/contact.t +++ b/t/app/controller/contact.t @@ -380,6 +380,41 @@ for my $test ( }; } +for my $test ( + { + fields => { + em => 'test@example.com', + name => 'A name', + subject => 'A subject', + message => 'A message', + dest => 'from_council', + success_url => '/faq', + }, + url_should_be => 'http://localhost/faq', + }, + { + fields => { + em => 'test@example.com', + name => 'A name', + subject => 'A subject', + message => 'A message', + dest => 'from_council', + success_url => 'http://www.example.com', + }, + url_should_be => 'http://www.example.com', + }, + ) +{ + subtest 'check user can be redirected to a custom URL after contact form is submitted' => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'fixmystreet' ], + }, sub { + $mech->post('/contact/submit', $test->{fields}); + is $mech->uri->as_string, $test->{url_should_be}; + } + }; +} + $problem_main->delete; done_testing(); |