aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet.pm3
-rw-r--r--perllib/FixMyStreet/App.pm8
2 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet.pm b/perllib/FixMyStreet.pm
index 6c664f1d1..cc5286bbb 100644
--- a/perllib/FixMyStreet.pm
+++ b/perllib/FixMyStreet.pm
@@ -92,12 +92,13 @@ sub override_config($&) {
mySociety::MaPit::configure($config->{MAPIT_URL}) if $config->{MAPIT_URL};
- # For historical reasons, we have two ways of askig for config variables.
+ # For historical reasons, we have two ways of asking for config variables.
# Override them both, I'm sure we'll find time to get rid of one eventually.
my $override_guard1 = Sub::Override->new(
"FixMyStreet::config",
sub {
my ($class, $key) = @_;
+ return { %CONFIG, %$config } unless $key;
return $config->{$key} if exists $config->{$key};
my $orig_config = mySociety::Config::load_default();
return $orig_config->{$key} if exists $orig_config->{$key};
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index cf766348f..4f70d2c68 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -208,6 +208,14 @@ sub setup_request {
DateTime->DefaultLocale( 'en_US' );
}
+ if (FixMyStreet->test_mode) {
+ # Is there a better way of altering $c->config that may have
+ # override_config involved?
+ $c->setup_finished(0);
+ $c->config( %{ FixMyStreet->config() } );
+ $c->setup_finished(1);
+ }
+
return $c;
}