From 53e00090b7eb6ead6bacb80475eebc61fe546cb8 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Fri, 12 Apr 2024 14:36:36 +0100 Subject: [PATCH] Remove specialist topics from email alert api pact --- CHANGELOG.md | 1 + test/pacts/email_alert_api_pact_test.rb | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e87b7e54..5d584520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * BREAKING: Rename imminence endpoints to places_manager [PR](https://github.com/alphagov/gds-api-adapters/pull/1253) * Note: This is used in Frontend only, so for other apps should not be breaking in practice. +* Update Pact specs to match the email-alert-api [PR](https://github.com/alphagov/email-alert-api/pull/2136) # 96.0.0 * BREAKING: Drop support for email-alert-api's bulk migrate endpoint diff --git a/test/pacts/email_alert_api_pact_test.rb b/test/pacts/email_alert_api_pact_test.rb index 9bab52ea..3a17c2f9 100644 --- a/test/pacts/email_alert_api_pact_test.rb +++ b/test/pacts/email_alert_api_pact_test.rb @@ -23,7 +23,7 @@ { id: Pact.like(1), links: {}, - tags: { topics: { any: ["motoring/road_rage"] } }, + tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }, document_type: "", slug: Pact.like("title-1"), title: Pact.like("title 1"), @@ -39,7 +39,7 @@ path: "/subscriber-lists", body: { title: "new-title", - tags: { topics: { any: ["motoring/road_rage"] } }, + tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }, }, headers: GdsApi::JsonClient.default_request_with_json_body_headers, ) @@ -53,19 +53,19 @@ }, ) - api_client.find_or_create_subscriber_list(title: "new-title", tags: { topics: { any: ["motoring/road_rage"] } }) + api_client.find_or_create_subscriber_list(title: "new-title", tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }) end it "responds with the subscriber list with an updated title" do email_alert_api - .given("a subscriber list with the tag topic: motoring/road_rage exists") + .given("a subscriber list with the tag tribunal decision category: motoring/road_rage exists") .upon_receiving("a request to find or create a subscriber list") .with( method: :post, path: "/subscriber-lists", body: { title: "new-title", - tags: { topics: { any: ["motoring/road_rage"] } }, + tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }, }, headers: GdsApi::JsonClient.default_request_with_json_body_headers, ) @@ -79,7 +79,7 @@ }, ) - api_client.find_or_create_subscriber_list(title: "new-title", tags: { topics: { any: ["motoring/road_rage"] } }) + api_client.find_or_create_subscriber_list(title: "new-title", tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }) end end @@ -92,7 +92,7 @@ path: "/subscriber-lists", # Query here is odd because the parser doesn't quite handle # the output of Rack::Utils.build_nested_query - query: { "tags[topics][any][]": ["motoring/road_rage"] }, + query: { "tags[tribunal_decision_categories][any][]": ["motoring/road_rage"] }, headers: GdsApi::JsonClient.default_request_headers, ) .will_respond_with( @@ -104,7 +104,7 @@ ) begin - api_client.find_subscriber_list(tags: { topics: { any: ["motoring/road_rage"] } }) + api_client.find_subscriber_list(tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }) rescue GdsApi::HTTPNotFound # We expect this to throw an exception end @@ -112,14 +112,14 @@ it "responds with the subscriber list" do email_alert_api - .given("a subscriber list with the tag topic: motoring/road_rage exists") + .given("a subscriber list with the tag tribunal decision category: motoring/road_rage exists") .upon_receiving("a request for the subscriber list") .with( method: :get, path: "/subscriber-lists", # Query here is odd because the parser doesn't quite handle # the output of Rack::Utils.build_nested_query - query: { "tags[topics][any][]": ["motoring/road_rage"] }, + query: { "tags[tribunal_decision_categories][any][]": ["motoring/road_rage"] }, headers: GdsApi::JsonClient.default_request_headers, ) .will_respond_with( @@ -132,7 +132,7 @@ }, ) - api_client.find_subscriber_list(tags: { topics: { any: ["motoring/road_rage"] } }) + api_client.find_subscriber_list(tags: { tribunal_decision_categories: { any: ["motoring/road_rage"] } }) end end