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

Don't notify Sentry when specialist document is missing finder #2015

Merged
merged 1 commit into from
Feb 12, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions app/presenters/specialist_document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,8 @@ def value_or_array_of_values(values)
values.length == 1 ? values.first : values
end

# Finder is a required link that must have 1 item
def finder
parent_finder = content_item.dig("links", "finder", 0)
if parent_finder.nil?
GovukError.notify(
"Finder not found",
extra: { error_message: "Finder not found in #{base_path} content item" },
)
end

parent_finder
content_item.dig("links", "finder", 0)
end

def facets
Expand Down
12 changes: 0 additions & 12 deletions test/presenters/specialist_document_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,6 @@ def example_facet(overrides = {})
assert_equal "1 January 2010", presented_metadata["Facet name"]
end

test "sends an error notification when there is no finder" do
example = schema_item("aaib-reports")
example["links"]["finder"] = []

GovukError.expects(:notify).with(
"Finder not found",
extra: { error_message: "Finder not found in /aaib-reports/aaib-investigation-to-rotorsport-uk-calidus-g-pcpc content item" },
)

present_example(example).important_metadata
end

test "omits first_published_at facet values from `other` section of component parameters to avoid duplicates" do
facets = [
{
Expand Down