Skip to content

Commit

Permalink
Merge pull request #149 from alphagov/revert-hmcts-block
Browse files Browse the repository at this point in the history
Revert "Don’t send emails for HMCTS content items"
  • Loading branch information
suzannehamilton committed Mar 21, 2018
2 parents 61e7b82 + db58e7e commit efbf6ad
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
9 changes: 0 additions & 9 deletions email_alert_service/models/message_processor.rb
Expand Up @@ -71,15 +71,6 @@ def email_alerts_supported?(document)
document_links = document.fetch("links", {})
document_type = document.fetch("document_type")

# Temporarily stop HMCTS-related content items from triggering
# email alerts while their forms are migrated to GOV.UK.
# This will be removed on 21/03/2018.
# This only works if HMCTS is the first organisation, which will
# be the case here.
document_expanded_links = document.fetch("expanded_links", {})
return false if document_expanded_links.dig("organisations", 0, "base_path") ==
"/government/organisations/hm-courts-and-tribunals-service"

contains_supported_attribute?(document_links) \
|| contains_supported_attribute?(document_tags) \
|| whitelisted_document_type?(document_type) \
Expand Down
33 changes: 0 additions & 33 deletions spec/models/message_processor_spec.rb
Expand Up @@ -37,30 +37,6 @@
}
end

let(:hmcts_document) do
{
"base_path" => "path/to-doc",
"title" => "Example title",
"document_type" => "example",
"description" => "example description",
"public_updated_at" => "2014-10-06T13:39:19.000+00:00",
"details" => {
"change_history" => change_history,
"tags" => {
"topics" => ["example topic"]
}
},
"expanded_links" => {
"topics" => ["example-topic-uuid"],
"organisations" => [
{
"base_path" => "/government/organisations/hm-courts-and-tribunals-service"
}
]
}
}
end

def email_was_triggered
expect(mock_email_alert).to have_received(:trigger)
end
Expand Down Expand Up @@ -224,15 +200,6 @@ def message_requeued
end
end

context "organisation is HMCTS" do
it "acknowledges but doesn't trigger the email" do
processor.process(hmcts_document.to_json, properties, delivery_info)

email_was_not_triggered
message_acknowledged
end
end

context "has links but is from a blacklisted publishing application" do
before do
good_document["details"] = { "change_history" => change_history }
Expand Down

0 comments on commit efbf6ad

Please sign in to comment.