diff options
author | Struan Donald <struan@exo.org.uk> | 2017-09-08 15:25:09 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-09-11 11:21:17 +0100 |
commit | c03096d4ffe3e17d504239ec4c0f006b1266c8e5 (patch) | |
tree | 5e8282bd3acdcfe7817fc9fd43bf42537b9546a5 | |
parent | c658dfe618a860a676e75254de5286150c837acb (diff) |
[Oxfordshire] tests for response time messages
-rw-r--r-- | t/Mock/MapIt.pm | 1 | ||||
-rw-r--r-- | t/cobrand/oxfordshire.t | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm index ad1d0c99c..926d94b1e 100644 --- a/t/Mock/MapIt.pm +++ b/t/Mock/MapIt.pm @@ -28,6 +28,7 @@ my @PLACES = ( [ 'SW1A 1AA', 51.501009, -0.141588, 2504, 'Westminster City Council', 'LBO' ], [ 'GL50 2PR', 51.896268, -2.093063, 2226, 'Gloucestershire County Council', 'CTY', 2326, 'Cheltenham Borough Council', 'DIS', 4544, 'Lansdown', 'DIW', 143641, 'Lansdown and Park', 'CED' ], [ '?', 51.754926, -1.256179, 2237, 'Oxfordshire County Council', 'CTY', 2421, 'Oxford City Council', 'DIS' ], + [ 'OX20 1SZ', 51.754926, -1.256179, 2237, 'Oxfordshire County Council', 'CTY', 2421, 'Oxford City Council', 'DIS' ], [ 'BR1 3UH', 51.4021, 0.01578, 2482, 'Bromley Council', 'LBO' ], [ '?', 50.78301, -0.646929 ], [ 'GU51 4AE', 51.279456, -0.846216, 2333, 'Hart District Council', 'DIS', 2227, 'Hampshire County Council', 'CTY' ], diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t index 89792765c..90fa8ccbf 100644 --- a/t/cobrand/oxfordshire.t +++ b/t/cobrand/oxfordshire.t @@ -145,6 +145,57 @@ EOF } }; +subtest 'response times messages displayed' => sub { + my $oxfordshire = $mech->create_body_ok( + 2237, 'Oxfordshire County Council' + ); + my $contact = $mech->create_contact_ok( + body_id => $oxfordshire->id, + category => 'Pothole', + email => 'pothole@example.com', + ); + + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'oxfordshire' ], + MAPIT_URL => 'http://mapit.uk/', + }, sub { + $mech->log_out_ok; + $mech->clear_emails_ok; + + $mech->get_ok('/around'); + $mech->submit_form_ok( { + with_fields => { pc => 'OX20 1SZ' } + }, + "submit_location" + ); + + $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, + "follow 'skip this step' link" ); + + $mech->submit_form_ok( + { + with_fields => { + title => 'Test Report', + detail => 'Test report details.', + photo1 => '', + email => 'test-2@example.com', + name => 'Test User', + category => 'Pothole', + } + }, + "submit details" + ); + + $mech->text_contains('Problems in the Pothole category are generally responded'); + my $email = $mech->get_email; + ok $email, 'got and email'; + like $mech->get_text_body_from_email, qr/Problems in the Pothole category/, 'emails contains response time message'; + my $url = $mech->get_link_from_email($email); + $mech->get_ok($url); + $mech->text_contains('Problems in the Pothole category are generally responded') + }; +}; + END { done_testing(); } |