Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove specialist topics from email alert api Pact tests #1250

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Update Pact specs to match the email-alert-api [PR](https://github.com/alphagov/email-alert-api/pull/2136)

# 96.0.0

* BREAKING: Rename imminence endpoints to places_manager [PR](https://github.com/alphagov/gds-api-adapters/pull/1253)
Expand Down
22 changes: 11 additions & 11 deletions test/pacts/email_alert_api_pact_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
id: Pact.like(1),
links: {},
tags: { topics: { any: ["motoring/road_rage"] } },
tags: { tribunal_decision_categories: { any: %w[agency-workers] } },
document_type: "",
slug: Pact.like("title-1"),
title: Pact.like("title 1"),
Expand All @@ -39,7 +39,7 @@
path: "/subscriber-lists",
body: {
title: "new-title",
tags: { topics: { any: ["motoring/road_rage"] } },
tags: { tribunal_decision_categories: { any: %w[agency-workers] } },
},
headers: GdsApi::JsonClient.default_request_with_json_body_headers,
)
Expand All @@ -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: %w[agency-workers] } })
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: agency-workers 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: %w[agency-workers] } },
},
headers: GdsApi::JsonClient.default_request_with_json_body_headers,
)
Expand All @@ -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: %w[agency-workers] } })
end
end

Expand All @@ -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][]": %w[agency-workers] },
headers: GdsApi::JsonClient.default_request_headers,
)
.will_respond_with(
Expand All @@ -104,22 +104,22 @@
)

begin
api_client.find_subscriber_list(tags: { topics: { any: ["motoring/road_rage"] } })
api_client.find_subscriber_list(tags: { tribunal_decision_categories: { any: %w[agency-workers] } })
rescue GdsApi::HTTPNotFound
# We expect this to throw an exception
end
end

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: agency-workers 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][]": %w[agency-workers] },
headers: GdsApi::JsonClient.default_request_headers,
)
.will_respond_with(
Expand All @@ -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: %w[agency-workers] } })
end
end

Expand Down