Skip to content

Commit

Permalink
Remove unused email unpublishing adapter
Browse files Browse the repository at this point in the history
See here for more information about this change [1].

[1]: alphagov/email-alert-api#1572
  • Loading branch information
Ben Thorner committed Jan 20, 2021
1 parent a96edeb commit cb5fd47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Remove unused email unpublish adapter

# 69.1.0

* Restore find_subscriber_list adapter (for Content Tagger)
Expand Down
11 changes: 0 additions & 11 deletions lib/gds_api/email_alert_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ def create_message(message, headers = {})
post_json("#{endpoint}/messages", message, headers)
end

# Unpublishing alert
#
# @param message [Hash] content_id
#
# Used by email-alert-service to send a message to email-alert-api
# when an unpublishing message is put on the Rabbitmq queue by
# publishing-api
def send_unpublish_message(message)
post_json("#{endpoint}/unpublish-messages", message)
end

# Get topic matches
#
# @param attributes [Hash] tags, links, document_type,
Expand Down
5 changes: 0 additions & 5 deletions lib/gds_api/test_helpers/email_alert_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ def stub_email_alert_api_refuses_to_create_subscriber_list
.to_return(status: 422)
end

def stub_email_alert_api_accepts_unpublishing_message
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/unpublish-messages")
.to_return(status: 202, body: {}.to_json)
end

def stub_email_alert_api_accepts_content_change
stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/content-changes")
.to_return(status: 202, body: {}.to_json)
Expand Down
18 changes: 0 additions & 18 deletions test/email_alert_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,6 @@
end
end

let(:unpublish_message) do
{
"content_id" => "content-id",
}
end

describe "unpublishing messages" do
before do
stub_email_alert_api_accepts_unpublishing_message
end

it "sends an unpublish message" do
assert api_client.send_unpublish_message(unpublish_message)

assert_requested(:post, "#{base_url}/unpublish-messages", body: unpublish_message.to_json)
end
end

describe "subscriptions" do
describe "URI encoding ids" do
it "encodes the id for #get_subscription" do
Expand Down

0 comments on commit cb5fd47

Please sign in to comment.