From 52ee0076ccc68bc7f132f693bb0549460b011d37 Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Wed, 27 Jul 2022 16:10:59 +0100 Subject: [PATCH] Remove all references to Mapit Mapit is no longer used, so we can remove these references. --- README.md | 2 +- app/lib/services.rb | 5 - docs/importing-local-authorities-data.md | 4 +- .../check_links/link_status_requester_spec.rb | 4 - .../import/fixtures/mapit.json | 146 ------------------ spec/support/webmock.rb | 8 - 6 files changed, 2 insertions(+), 167 deletions(-) delete mode 100644 spec/lib/local-links-manager/import/fixtures/mapit.json diff --git a/README.md b/README.md index 0058edb8d..75b9c804a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Admin interface for managing Local Authorities' links including all their servic For example, [this service](https://www.gov.uk/garden-waste-disposal) uses Local Links Manager to determine the URL of the garden waste disposal page on the Local Authority website which corresponds to the postcode a user has entered. -Note that Local Links Manager does not determine a user's Local Authority based on their postcode. We use [Mapit](https://github.com/alphagov/mapit) for that. +Note that Local Links Manager does not determine a user's Local Authority based on their postcode. This app maps RESTful URLs onto a persistence layer. It doesn't face public users. diff --git a/app/lib/services.rb b/app/lib/services.rb index 506555879..f9c80da4a 100644 --- a/app/lib/services.rb +++ b/app/lib/services.rb @@ -1,12 +1,7 @@ require "redis" -require "gds_api/mapit" require "gds_api/publishing_api" module Services - def self.mapit - @mapit ||= GdsApi.mapit(disable_cache: Rails.env.test?) - end - def self.icinga_check(service_desc, code, message) if Rails.env.production? `/usr/local/bin/notify_passive_check #{service_desc.shellescape} #{code.shellescape} #{message.shellescape}` diff --git a/docs/importing-local-authorities-data.md b/docs/importing-local-authorities-data.md index 4fabe8fb5..feb49f102 100644 --- a/docs/importing-local-authorities-data.md +++ b/docs/importing-local-authorities-data.md @@ -1,8 +1,6 @@ # Importing Local Authorities data -Before running the import rake tasks make sure you have Mapit running locally and have imported data into it. - -Import all local authorities: +Import all local authorities from `data/local-authorities.csv`: `bundle exec rake import:local_authorities:import_all` diff --git a/spec/lib/local-links-manager/check_links/link_status_requester_spec.rb b/spec/lib/local-links-manager/check_links/link_status_requester_spec.rb index 5e5a76557..8792ea9af 100644 --- a/spec/lib/local-links-manager/check_links/link_status_requester_spec.rb +++ b/spec/lib/local-links-manager/check_links/link_status_requester_spec.rb @@ -32,8 +32,6 @@ webhook_secret_token: Rails.application.secrets.link_checker_api_secret_token, ) - stub_request(:get, "/mapit/") - link_status_requester.call expect(stub1).to have_been_requested @@ -77,8 +75,6 @@ webhook_secret_token: Rails.application.secrets.link_checker_api_secret_token, ) - stub_request(:get, "/mapit/") - link_status_requester.check_authority_urls "ambridge" expect(stub1).to have_been_requested diff --git a/spec/lib/local-links-manager/import/fixtures/mapit.json b/spec/lib/local-links-manager/import/fixtures/mapit.json deleted file mode 100644 index 5f6964c13..000000000 --- a/spec/lib/local-links-manager/import/fixtures/mapit.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "2120": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 2120, - "codes": { - "ons": "00QA", - "gss": "S12000033", - "unit_id": "30421", - "govuk_slug": "aberdeen-city-council" - }, - "name": "Aberdeen City Council", - "country": "S", - "type_name": "Unitary Authority", - "generation_low": 1, - "country_name": "Scotland", - "type": "UTA" - }, - "2118": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 2118, - "codes": { - "ons": "00QB", - "gss": "S12000034", - "unit_id": "30111", - "govuk_slug": "aberdeenshire-council" - }, - "name": "Aberdeenshire Council", - "country": "S", - "type_name": "Unitary Authority", - "generation_low": 1, - "country_name": "Scotland", - "type": "UTA" - }, - "1938": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 1938, - "codes": { - "ons": "45UB", - "gss": "E07000223", - "unit_id": "16223", - "govuk_slug": "adur-district-council" - }, - "name": "Adur District Council", - "country": "E", - "type_name": "District council", - "generation_low": 1, - "country_name": "England", - "type": "DIS" - }, - "1724": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 1724, - "codes": { - "ons": "11", - "gss": "E10000002", - "unit_id": "11901", - "govuk_slug": "buckinghamshire-county-council" - }, - "name": "Buckinghamshire County Council", - "country": "E", - "type_name": "County council", - "generation_low": 1, - "country_name": "England", - "type": "CTY" - }, - "2131": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 2131, - "codes": { - "ons": "00HF", - "gss": "E06000053", - "unit_id": "43972", - "govuk_slug": "scilly-council" - }, - "name": "Isles of Scilly Council", - "country": "E", - "type_name": "Scilly Isles", - "generation_low": 1, - "country_name": "England", - "type": "COI" - }, - "1977": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 1977, - "codes": { - "ons": "00AU", - "gss": "E09000019", - "unit_id": "11281", - "govuk_slug": "islington-council" - }, - "name": "Islington Borough Council", - "country": "E", - "type_name": "London borough", - "generation_low": 1, - "country_name": "England", - "type": "LBO" - }, - "1994": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 1994, - "codes": { - "ons": "00CZ", - "gss": "E08000034", - "unit_id": "16665", - "govuk_slug": "kirklees-council" - }, - "name": "Kirklees Borough Council", - "country": "E", - "type_name": "Metropolitan district", - "generation_low": 1, - "country_name": "England", - "type": "MTD" - }, - "12192": { - "parent_area": null, - "generation_high": 1, - "all_names": {}, - "id": 12192, - "codes": { - "osni_oid": "LGD-7", - "ons": "N09000007", - "gss": "N09000007", - "govuk_slug": "lisburn-and-castlereagh-council" - }, - "name": "Lisburn and Castlereagh City Council", - "country": "N", - "type_name": "Northern Irish Council", - "generation_low": 1, - "country_name": "Northern Ireland", - "type": "LGD" - } -} diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb index b2de810bd..4b72e2ceb 100644 --- a/spec/support/webmock.rb +++ b/spec/support/webmock.rb @@ -1,11 +1,3 @@ require "webmock/rspec" WebMock.disable_net_connect!(allow_localhost: true) - -RSpec.configure do |config| - config.before(:each) do - stub_request(:get, /mapit/) - .with(headers: { "Accept" => "*/*", "User-Agent" => "Ruby" }) - .to_return(status: 200, body: "{}", headers: {}) - end -end