diff options
author | matthew <matthew> | 2009-09-24 21:41:02 +0000 |
---|---|---|
committer | matthew <matthew> | 2009-09-24 21:41:02 +0000 |
commit | d3e41fc3af02f17e04b31a5433555d84b38babf8 (patch) | |
tree | 6fe6042040cd97423c1ec407696e2aafda794af3 | |
parent | 48aa111abca3b723df4af3de6915f1ef3594a4ba (diff) |
Add test checks.
-rwxr-xr-x | bin/test-run | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/test-run b/bin/test-run index b7f9c4ce8..dee2b0add 100755 --- a/bin/test-run +++ b/bin/test-run @@ -19,7 +19,7 @@ # RSS # Whatever I've missed! -my $rcsid = ''; $rcsid .= '$Id: test-run,v 1.23 2009-09-24 20:41:36 matthew Exp $'; +my $rcsid = ''; $rcsid .= '$Id: test-run,v 1.24 2009-09-24 21:41:02 matthew Exp $'; use strict; require 5.8.0; @@ -491,23 +491,23 @@ sub do_static { $wth->email_get_containing('%This is a test message%'); } +# Check RSS feeds redirect to the right places and so on. +# Just checks header, doesn't check any contents. sub do_rss { $wth->browser_get($base_url . '/rss/l/52.5/-1.9'); - print $wth->browser_uri() . "\n"; + die "Lat/lon redirect failed" unless $wth->browser_uri() =~ m{/rss/2522/1792$}; $wth->browser_get($base_url . '/rss/2524/1779'); - print $wth->browser_uri() . "\n"; + $wth->browser_check_contents('New local problems on FixMyStreet'); $wth->browser_get($base_url . '/rss/pc/SW1A1AA'); - print $wth->browser_uri() . "\n"; + die "Postcode redirect failed" unless $wth->browser_uri() =~ m{/rss/3279/1113$}; $wth->browser_get($base_url . '/rss/area/Birmingham'); - print $wth->browser_uri() . "\n"; + die "One-tier redirect failed" unless $wth->browser_uri() =~ m{/rss/reports/Birmingham$}; $wth->browser_get($base_url . '/rss/reports/Birmingham'); - print $wth->browser_uri() . "\n"; + $wth->browser_check_contents('New problems to Birmingham City Council on FixMyStreet'); $wth->browser_get($base_url . '/rss/reports/Birmingham/Lozells'); - print $wth->browser_uri() . "\n"; - $wth->browser_get($base_url . '/rss/reports/Gloucestershire'); - print $wth->browser_uri() . "\n"; + $wth->browser_check_contents('New problems for Birmingham City Council within Lozells ward on FixMyStreet'); $wth->browser_get($base_url . '/rss/area/Gloucestershire'); - print $wth->browser_uri() . "\n"; + $wth->browser_check_contents('New problems within Gloucestershire\'s boundary on FixMyStreet'); } #browser_get(URL) |