aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_display.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-10-23 22:38:20 +0100
committerMatthew Somerville <matthew@mysociety.org>2013-10-24 21:34:46 +0100
commitcd51c26830d4f6ba144874e2f26010f7b6b76636 (patch)
tree17a0316b6c461e2ba45ac1d462772bf37fddc38e /t/app/controller/report_display.t
parent0b28f2ac1af652c37eda35f944b5eb78f4adf5d1 (diff)
Fix test suite to run regardless of config setup.
Diffstat (limited to 't/app/controller/report_display.t')
-rw-r--r--t/app/controller/report_display.t26
1 files changed, 14 insertions, 12 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index c17ee70ea..07e8caa9b 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -97,15 +97,16 @@ subtest "change report to unconfirmed and check for 404 status" => sub {
subtest "Zurich unconfirmeds are 200" => sub {
- if ( !FixMyStreet::Cobrand->exists('zurich') ) {
- plan skip_all => 'Skipping Zurich test without Zurich cobrand';
- }
- $mech->host( 'zurich.example.com' );
- ok $report->update( { state => 'unconfirmed' } ), 'unconfirm report';
- $mech->get_ok("/report/$report_id");
- $mech->content_contains( '&Uuml;berpr&uuml;fung ausstehend' );
- ok $report->update( { state => 'confirmed' } ), 'confirm report again';
- $mech->host( 'www.fixmystreet.com' );
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'zurich' ],
+ }, sub {
+ $mech->host( 'zurich.example.com' );
+ ok $report->update( { state => 'unconfirmed' } ), 'unconfirm report';
+ $mech->get_ok("/report/$report_id");
+ $mech->content_contains( '&Uuml;berpr&uuml;fung ausstehend' );
+ ok $report->update( { state => 'confirmed' } ), 'confirm report again';
+ $mech->host( 'www.fixmystreet.com' );
+ };
};
subtest "change report to hidden and check for 410 status" => sub {
@@ -400,9 +401,9 @@ for my $test (
}
subtest "Zurich banners are displayed correctly" => sub {
- if ( !FixMyStreet::Cobrand->exists('zurich') ) {
- plan skip_all => 'Skipping Zurich test without Zurich cobrand';
- }
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'zurich' ],
+ }, sub {
$mech->host( 'zurich.example.com' );
for my $test (
@@ -466,6 +467,7 @@ subtest "Zurich banners are displayed correctly" => sub {
}
$mech->host( 'www.fixmystreet.com' );
+ };
};
$mech->create_body_ok(2504, 'Westminster City Council');