From 4d44ea5530a7dc25122e5135c19d89b4cebc5f40 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 7 Dec 2016 11:39:59 +0000 Subject: [Oxfordshire] Add Exor RDI file download feature The RDI file format encapsulates information about inspections that have taken place, and can be uploaded into Exor to create defects in bulk. This commit adds a page to the Oxfordshire cobrand's admin allowing RDI files to be generated and downloaded from FMS. For mysociety/fixmystreetforcouncils#127 --- t/cobrand/oxfordshire.t | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 't') diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t index d9f880d07..b0fad3b56 100644 --- a/t/cobrand/oxfordshire.t +++ b/t/cobrand/oxfordshire.t @@ -45,6 +45,29 @@ subtest 'check /ajax defaults to open reports only' => sub { } }; +my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1); + +subtest 'Exor RDI download appears on Oxfordshire cobrand admin' => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ { 'oxfordshire' => '.' } ], + }, sub { + $mech->log_in_ok( $superuser->email ); + $mech->get_ok('/admin'); + $mech->content_contains("Download Exor RDI"); + } +}; + +subtest 'Exor RDI download doesn’t appear outside of Oxfordshire cobrand admin' => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], + }, sub { + $mech->log_in_ok( $superuser->email ); + $mech->get_ok('/admin'); + $mech->content_lacks("Download Exor RDI"); + } +}; + # Clean up +$mech->delete_user( $superuser ); $mech->delete_problems_for_body( 2237 ); done_testing(); -- cgit v1.2.3