From 01b02f69e0149c4dff39c8b237a465af237e3a11 Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Mon, 2 Oct 2023 16:22:30 +0100 Subject: [PATCH] Fix set_up/tear_down order --- spec/service_consumer/pact_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/service_consumer/pact_helper.rb b/spec/service_consumer/pact_helper.rb index 2bedf8f..8e81069 100644 --- a/spec/service_consumer/pact_helper.rb +++ b/spec/service_consumer/pact_helper.rb @@ -36,6 +36,9 @@ def url_encode(str) set_up do ENV["OS_PLACES_API_KEY"] = "some_key" ENV["OS_PLACES_API_SECRET"] = "some_secret" + end + + tear_down do postcode = Postcode.find_by(postcode: "SW1A1AA") postcode.destroy unless postcode.nil? end