aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/Mock/MapItZurich.pm6
-rw-r--r--t/cobrand/zurich.t15
2 files changed, 20 insertions, 1 deletions
diff --git a/t/Mock/MapItZurich.pm b/t/Mock/MapItZurich.pm
index ece9a9b22..9195749f6 100644
--- a/t/Mock/MapItZurich.pm
+++ b/t/Mock/MapItZurich.pm
@@ -38,6 +38,12 @@ sub dispatch_request {
my $json = $self->json->encode({});
return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
},
+
+ sub (GET + /area/*/children) {
+ my ($self, $area) = @_;
+ my $json = $self->json->encode({});
+ return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
+ },
}
__PACKAGE__->run_if_script;
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index b59e546dd..ddaae1f90 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -102,8 +102,9 @@ sub get_export_rows_count {
my $EXISTING_REPORT_COUNT = 0;
+my $superuser;
subtest "set up superuser" => sub {
- my $superuser = $mech->log_in_ok( 'super@example.org' );
+ $superuser = $mech->log_in_ok( 'super@example.org' );
# a user from body $zurich is a superuser, as $zurich has no parent id!
$superuser->update({ from_body => $zurich->id });
$EXISTING_REPORT_COUNT = get_export_rows_count($mech);
@@ -968,6 +969,18 @@ subtest 'time_spent' => sub {
$mech->log_out_ok;
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'zurich' ],
+ MAPIT_URL => 'http://mapit.zurich/',
+ MAPIT_TYPES => [ 'ZZZ' ],
+}, sub {
+ LWP::Protocol::PSGI->register(t::Mock::MapItZurich->run_if_script, host => 'mapit.zurich');
+ subtest 'users at the top level can be edited' => sub {
+ $mech->log_in_ok( $superuser->email );
+ $mech->get_ok('/admin/user_edit/' . $superuser->id );
+ };
+};
+
END {
$mech->delete_body($subdivision);
$mech->delete_body($division);