File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,13 +156,14 @@ def app = described_class
156156 end
157157
158158 it 'renders XML error when static feed generation fails' do
159- allow ( Html2rss ::Web ::XmlBuilder ) . to receive ( :build_error_feed ) . and_return ( '<error/>' )
160-
161159 get '/missing-feed'
160+ xml = Nokogiri ::XML ( last_response . body )
162161
163162 expect ( last_response . status ) . to eq ( 404 )
164163 expect ( last_response . headers [ 'Content-Type' ] ) . to eq ( 'application/xml' )
165- expect ( last_response . body ) . to eq ( '<error/>' )
164+ expect ( xml . at_xpath ( '/rss/channel/title' ) &.text ) . to eq ( 'Error' )
165+ expect ( xml . at_xpath ( '/rss/channel/description' ) &.text )
166+ . to eq ( "Failed to generate feed: Feed 'missing-feed' is not available on this instance" )
166167 end
167168
168169 it 'renders JSON Feed-shaped errors when static json feed generation fails' do
You can’t perform that action at this time.
0 commit comments