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/rss.t | |
parent | 0b28f2ac1af652c37eda35f944b5eb78f4adf5d1 (diff) |
Fix test suite to run regardless of config setup.
Diffstat (limited to 't/app/controller/rss.t')
-rw-r--r-- | t/app/controller/rss.t | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t index ec6a01b50..bafa1ddc0 100644 --- a/t/app/controller/rss.t +++ b/t/app/controller/rss.t @@ -42,8 +42,13 @@ my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( { user_id => $user1->id, } ); - -$mech->get_ok("/rss/pc/EH11BB/2"); +$mech->host('www.fixmystreet.com'); +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'fixmystreet' ], + MAPIT_URL => 'http://mapit.mysociety.org/', +}, sub { + $mech->get_ok("/rss/pc/EH11BB/2"); +}; $mech->content_contains( "Testing, 10th October" ); $mech->content_lacks( 'Nearest road to the pin' ); @@ -111,7 +116,12 @@ $report->geocode( ); $report->update(); -$mech->get_ok("/rss/pc/EH11BB/2"); +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'fixmystreet' ], + MAPIT_URL => 'http://mapit.mysociety.org/', +}, sub { + $mech->get_ok("/rss/pc/EH11BB/2"); +}; $mech->content_contains( "Testing, 10th October" ); $mech->content_contains( '18 North Bridge, Edinburgh' ); @@ -168,11 +178,17 @@ my $report_to_county_council = FixMyStreet::App->model('DB::Problem')->find_or_c subtest "check RSS feeds on cobrand have correct URLs for non-cobrand reports" => sub { $mech->host('lichfielddc.fixmystreet.com'); - $mech->get_ok("/rss/area/Lichfield"); - my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id; - my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new(); - my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id; + my $expected2; + + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'lichfielddc' ], + MAPIT_URL => 'http://mapit.mysociety.org/', + }, sub { + $mech->get_ok("/rss/area/Lichfield"); + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new(); + $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id; + }; $mech->content_contains($expected1, 'non cobrand area report point to fixmystreet.com'); $mech->content_contains($expected2, 'cobrand area report point to cobrand url'); |