diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-19 15:13:36 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-19 15:13:36 +0100 |
commit | 4d2520605ddbc644a2e835a967659e92511e7961 (patch) | |
tree | 4de881b673c9eaad5dfa807d178b18581fb5b553 /t/app/controller/reports.t | |
parent | b362778c0204eeca8919ad2a2d1f20cd308a20e5 (diff) | |
parent | 7d563605520e92c6c3c1441a2c89cce127e16b72 (diff) |
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 't/app/controller/reports.t')
-rw-r--r-- | t/app/controller/reports.t | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t new file mode 100644 index 000000000..6cb12e20f --- /dev/null +++ b/t/app/controller/reports.t @@ -0,0 +1,34 @@ +use strict; +use warnings; +use Test::More; +use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; +use mySociety::MaPit; + +ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' ); + +# check that we can get the page +$mech->get_ok('/reports'); +$mech->title_like(qr{Summary reports}); +$mech->content_contains('Birmingham'); +$mech->follow_link_ok( { text_regex => qr/Birmingham/ } ); + +SKIP: { + skip( "Need 'emptyhomes' in ALLOWED_COBRANDS config", 8 ) + unless FixMyStreet::App->config->{ALLOWED_COBRANDS} =~ m{emptyhomes}; + ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes'; + $mech->get_ok('/reports'); + # EHA lacks one column the others have + $mech->content_lacks('state unknown'); + + skip( "Need 'fiksgatami' in ALLOWED_COBRANDS config", 8 ) + unless FixMyStreet::App->config->{ALLOWED_COBRANDS} =~ m{fiksgatami}; + mySociety::MaPit::configure('http://mapit.nuug.no/'); + ok $mech->host("fiksgatami.no"), 'change host to fiksgatami'; + $mech->get_ok('/reports'); + # There should only be one Oslo + $mech->content_contains('Oslo'); + $mech->content_unlike(qr{Oslo">Oslo.*Oslo}s); +} + +done_testing(); + |