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

Fix atom feed - respond to html #3417

Merged
merged 1 commit into from
Feb 13, 2023
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
2 changes: 1 addition & 1 deletion app/views/catalog/_document_default.atom.builder
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ xml.entry do

xml.author { xml.name(document.to_semantic_values[:author].first) } if document.to_semantic_values.key? :author

with_format('html') do
with_format(:html) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 I can't believe this was all it took to break our feed!

xml.summary 'type' => 'html' do
xml.text! render partial: 'atom_index', locals: { document: }
end
Expand Down
14 changes: 14 additions & 0 deletions spec/requests/catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@
expect(response.body).to match(/start over/)
end
end

describe 'atom feed' do
let(:url) do
"/catalog?format=atom&search_field=all_fields&q="
end

before { stub_holding_locations }

it 'renders the page' do
get url
expect(response).to be_successful
expect(response.content_type).to eq("application/atom+xml; charset=utf-8")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

end
end
end