+++ /dev/null
-atom_feed(:language => I18n.locale, :schema_date => 2009,
- :id => url_for(params.merge(:only_path => false)),
- :root_url => url_for(params.merge(:only_path => false, :format => nil)),
- "xmlns:georss" => "http://www.georss.org/georss") do |feed|
- feed.title @title
-
- feed.subtitle :type => "xhtml" do |xhtml|
- xhtml.p do |p|
- p << t(".sorry")
- end
- end
-end
--- /dev/null
+xml.rss("version" => "2.0",
+ "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
+ xml.channel do
+ if params[:changeset_id]
+ xml.title t("changeset_comments.feeds.show.title_particular", :changeset_id => params[:changeset_id])
+ else
+ xml.title t("changeset_comments.feeds.show.title_all")
+ end
+ xml.link root_url
+ xml.description t(".sorry")
+ end
+end
get changesets_comments_feed_path(:format => "rss", :limit => 100001)
assert_response :bad_request
end
+
+ def test_feed_timeout
+ with_settings(:web_timeout => -1) do
+ get changesets_comments_feed_path
+ end
+ assert_response :error
+ assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+ assert_dom "rss>channel>title", :text => "OpenStreetMap changeset discussion"
+ assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+ end
+
+ def test_feed_changeset_timeout
+ with_settings(:web_timeout => -1) do
+ get changeset_comments_feed_path(123)
+ end
+ assert_response :error
+ assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+ assert_dom "rss>channel>title", :text => "OpenStreetMap changeset #123 discussion"
+ assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+ end
end
end