diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-10-23 22:38:20 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-10-24 21:34:46 +0100 |
commit | cd51c26830d4f6ba144874e2f26010f7b6b76636 (patch) | |
tree | 17a0316b6c461e2ba45ac1d462772bf37fddc38e /t/app/controller/alert.t | |
parent | 0b28f2ac1af652c37eda35f944b5eb78f4adf5d1 (diff) |
Fix test suite to run regardless of config setup.
Diffstat (limited to 't/app/controller/alert.t')
-rw-r--r-- | t/app/controller/alert.t | 85 |
1 files changed, 45 insertions, 40 deletions
diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t index 847aa1a17..6fab4d3e3 100644 --- a/t/app/controller/alert.t +++ b/t/app/controller/alert.t @@ -12,56 +12,61 @@ $mech->content_contains('Local RSS feeds and email alerts'); $mech->content_contains('html class="no-js" lang="en-gb"'); # check that we can get list page -$mech->get_ok('/alert/list'); -$mech->title_like(qr/^Local RSS feeds and email alerts/); -$mech->content_contains('Local RSS feeds and email alerts'); -$mech->content_contains('html class="no-js" lang="en-gb"'); +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], + MAPIT_URL => 'http://mapit.mysociety.org/', +}, sub { + $mech->get_ok('/alert/list'); + $mech->title_like(qr/^Local RSS feeds and email alerts/); + $mech->content_contains('Local RSS feeds and email alerts'); + $mech->content_contains('html class="no-js" lang="en-gb"'); -$mech->get_ok('/alert/list?pc=EH99 1SP'); -$mech->title_like(qr/^Local RSS feeds and email alerts/); -$mech->content_contains('Here are the types of local problem alerts for ‘EH99 1SP’'); -$mech->content_contains('html class="no-js" lang="en-gb"'); -$mech->content_contains('Problems within 8.5km'); -$mech->content_contains('rss/pc/EH991SP/2'); -$mech->content_contains('rss/pc/EH991SP/5'); -$mech->content_contains('rss/pc/EH991SP/10'); -$mech->content_contains('rss/pc/EH991SP/20'); -$mech->content_contains('Problems within City of Edinburgh'); -$mech->content_contains('Problems within City Centre ward'); -$mech->content_contains('/rss/reports/City+of+Edinburgh'); -$mech->content_contains('/rss/reports/City+of+Edinburgh/City+Centre'); -$mech->content_contains('council:2651:City_of_Edinburgh'); -$mech->content_contains('ward:2651:20728:City_of_Edinburgh:City_Centre'); + $mech->get_ok('/alert/list?pc=EH99 1SP'); + $mech->title_like(qr/^Local RSS feeds and email alerts/); + $mech->content_contains('Here are the types of local problem alerts for ‘EH99 1SP’'); + $mech->content_contains('html class="no-js" lang="en-gb"'); + $mech->content_contains('Problems within 8.5km'); + $mech->content_contains('rss/pc/EH991SP/2'); + $mech->content_contains('rss/pc/EH991SP/5'); + $mech->content_contains('rss/pc/EH991SP/10'); + $mech->content_contains('rss/pc/EH991SP/20'); + $mech->content_contains('Problems within City of Edinburgh'); + $mech->content_contains('Problems within City Centre ward'); + $mech->content_contains('/rss/reports/City+of+Edinburgh'); + $mech->content_contains('/rss/reports/City+of+Edinburgh/City+Centre'); + $mech->content_contains('council:2651:City_of_Edinburgh'); + $mech->content_contains('ward:2651:20728:City_of_Edinburgh:City_Centre'); -$mech->get_ok('/alert/list?pc=High Street'); -$mech->content_contains('We found more than one match for that location'); + $mech->get_ok('/alert/list?pc=High Street'); + $mech->content_contains('We found more than one match for that location'); -$mech->get_ok('/alert/list?pc='); -$mech->content_contains('To find out what local alerts we have for you'); + $mech->get_ok('/alert/list?pc='); + $mech->content_contains('To find out what local alerts we have for you'); -$mech->get_ok('/alert/list?pc=GL502PR'); -$mech->content_contains('Problems within the boundary of'); + $mech->get_ok('/alert/list?pc=GL502PR'); + $mech->content_contains('Problems within the boundary of'); -$mech->get_ok('/alert/subscribe?rss=1&type=local&pc=ky16+8yg&rss=Give+me+an+RSS+feed&rznvy=' ); -$mech->content_contains('Please select the feed you want'); + $mech->get_ok('/alert/subscribe?rss=1&type=local&pc=ky16+8yg&rss=Give+me+an+RSS+feed&rznvy=' ); + $mech->content_contains('Please select the feed you want'); -$mech->get_ok('/alert/subscribe?rss=1&feed=invalid:1000:A_Locationtype=local&pc=ky16+8yg&rss=Give+me+an+RSS+feed&rznvy='); -$mech->content_contains('Illegal feed selection'); + $mech->get_ok('/alert/subscribe?rss=1&feed=invalid:1000:A_Locationtype=local&pc=ky16+8yg&rss=Give+me+an+RSS+feed&rznvy='); + $mech->content_contains('Illegal feed selection'); -$mech->create_body_ok(2504, 'Birmingham City Council'); -$mech->create_body_ok(2226, 'Gloucestershire County Council'); -$mech->create_body_ok(2326, 'Cheltenham Borough Council'); + $mech->create_body_ok(2504, 'Birmingham City Council'); + $mech->create_body_ok(2226, 'Gloucestershire County Council'); + $mech->create_body_ok(2326, 'Cheltenham Borough Council'); -$mech->get_ok('/alert/subscribe?rss=1&feed=area:1000:Birmingham'); -is $mech->uri->path, '/rss/reports/Birmingham'; + $mech->get_ok('/alert/subscribe?rss=1&feed=area:1000:Birmingham'); + is $mech->uri->path, '/rss/reports/Birmingham'; -$mech->get_ok('/alert/subscribe?rss=1&feed=area:1000:1001:Cheltenham:Lansdown'); -is $mech->uri->path, '/rss/area/Cheltenham/Lansdown'; + $mech->get_ok('/alert/subscribe?rss=1&feed=area:1000:1001:Cheltenham:Lansdown'); + is $mech->uri->path, '/rss/area/Cheltenham/Lansdown'; -$mech->get_ok('/alert/subscribe?rss=1&feed=council:1000:Gloucestershire'); -is $mech->uri->path, '/rss/reports/Gloucestershire'; + $mech->get_ok('/alert/subscribe?rss=1&feed=council:1000:Gloucestershire'); + is $mech->uri->path, '/rss/reports/Gloucestershire'; -$mech->get_ok('/alert/subscribe?rss=1&feed=ward:1000:1001:Cheltenham:Lansdown'); -is $mech->uri->path, '/rss/reports/Cheltenham/Lansdown'; + $mech->get_ok('/alert/subscribe?rss=1&feed=ward:1000:1001:Cheltenham:Lansdown'); + is $mech->uri->path, '/rss/reports/Cheltenham/Lansdown'; +}; done_testing(); |