Skip to content

Commit

Permalink
Fix atom feed - respond to html (#3417)
Browse files Browse the repository at this point in the history
Closes #3406
  • Loading branch information
maxkadel committed Feb 13, 2023
1 parent ddf15f8 commit 0c015d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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
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")
end
end
end

0 comments on commit 0c015d2

Please sign in to comment.