From c72ad96cb053a0545074674e4572f2b009b9e071 Mon Sep 17 00:00:00 2001 From: Max Kadel Date: Mon, 13 Feb 2023 09:15:15 -0500 Subject: [PATCH] Fix atom feed - respond to html Closes #3406 --- app/views/catalog/_document_default.atom.builder | 2 +- spec/requests/catalog_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/catalog/_document_default.atom.builder b/app/views/catalog/_document_default.atom.builder index 774039a19..38392756b 100644 --- a/app/views/catalog/_document_default.atom.builder +++ b/app/views/catalog/_document_default.atom.builder @@ -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 diff --git a/spec/requests/catalog_spec.rb b/spec/requests/catalog_spec.rb index d1398de25..f13856a9c 100644 --- a/spec/requests/catalog_spec.rb +++ b/spec/requests/catalog_spec.rb @@ -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