##// END OF EJS Templates
Fixed double escaping of Atom feed links....
Etienne Massip -
r8526:54c0b531e127
parent child
Show More
@@ -1,8 +1,8
1 xml.instruct!
1 xml.instruct!
2 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
2 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3 xml.title truncate_single_line(@title, :length => 100)
3 xml.title truncate_single_line(@title, :length => 100)
4 xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false))
4 xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false, :escape => false))
5 xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
5 xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil, :escape => false))
6 xml.id url_for(:controller => 'welcome', :only_path => false)
6 xml.id url_for(:controller => 'welcome', :only_path => false)
7 xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
7 xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
8 xml.author { xml.name "#{Setting.app_title}" }
8 xml.author { xml.name "#{Setting.app_title}" }
@@ -97,9 +97,39 class ActivitiesControllerTest < ActionController::TestCase
97 end
97 end
98
98
99 def test_index_atom_feed
99 def test_index_atom_feed
100 get :index, :format => 'atom'
100 get :index, :format => 'atom', :with_subprojects => 0
101 assert_response :success
101 assert_response :success
102 assert_template 'common/feed.atom'
102 assert_template 'common/feed.atom'
103
104 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
105 :attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?with_subprojects=0'}
106 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
107 :attributes => {:rel => 'alternate', :href => 'http://test.host/activity?with_subprojects=0'}
108
109 assert_tag :tag => 'entry', :child => {
110 :tag => 'link',
111 :attributes => {:href => 'http://test.host/issues/11'}}
112 end
113
114 def test_index_atom_feed_with_explicit_selection
115 get :index, :format => 'atom', :with_subprojects => 0,
116 :show_changesets => 1,
117 :show_documents => 1,
118 :show_files => 1,
119 :show_issues => 1,
120 :show_messages => 1,
121 :show_news => 1,
122 :show_time_entries => 1,
123 :show_wiki_edits => 1
124
125 assert_response :success
126 assert_template 'common/feed.atom'
127
128 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
129 :attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?show_changesets=1&amp;show_documents=1&amp;show_files=1&amp;show_issues=1&amp;show_messages=1&amp;show_news=1&amp;show_time_entries=1&amp;show_wiki_edits=1&amp;with_subprojects=0'}
130 assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
131 :attributes => {:rel => 'alternate', :href => 'http://test.host/activity?show_changesets=1&amp;show_documents=1&amp;show_files=1&amp;show_issues=1&amp;show_messages=1&amp;show_news=1&amp;show_time_entries=1&amp;show_wiki_edits=1&amp;with_subprojects=0'}
132
103 assert_tag :tag => 'entry', :child => {
133 assert_tag :tag => 'entry', :child => {
104 :tag => 'link',
134 :tag => 'link',
105 :attributes => {:href => 'http://test.host/issues/11'}}
135 :attributes => {:href => 'http://test.host/issues/11'}}
General Comments 0
You need to be logged in to leave comments. Login now