Fixed double escaping of Atom feed links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8646 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
002081f224
commit
54c0b531e1
|
@ -1,8 +1,8 @@
|
||||||
xml.instruct!
|
xml.instruct!
|
||||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
||||||
xml.title truncate_single_line(@title, :length => 100)
|
xml.title truncate_single_line(@title, :length => 100)
|
||||||
xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false))
|
xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false, :escape => false))
|
||||||
xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
|
xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil, :escape => false))
|
||||||
xml.id url_for(:controller => 'welcome', :only_path => false)
|
xml.id url_for(:controller => 'welcome', :only_path => false)
|
||||||
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
|
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
|
||||||
xml.author { xml.name "#{Setting.app_title}" }
|
xml.author { xml.name "#{Setting.app_title}" }
|
||||||
|
|
|
@ -97,9 +97,39 @@ class ActivitiesControllerTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_index_atom_feed
|
def test_index_atom_feed
|
||||||
get :index, :format => 'atom'
|
get :index, :format => 'atom', :with_subprojects => 0
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'common/feed.atom'
|
assert_template 'common/feed.atom'
|
||||||
|
|
||||||
|
assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
|
||||||
|
:attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?with_subprojects=0'}
|
||||||
|
assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
|
||||||
|
:attributes => {:rel => 'alternate', :href => 'http://test.host/activity?with_subprojects=0'}
|
||||||
|
|
||||||
|
assert_tag :tag => 'entry', :child => {
|
||||||
|
:tag => 'link',
|
||||||
|
:attributes => {:href => 'http://test.host/issues/11'}}
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_index_atom_feed_with_explicit_selection
|
||||||
|
get :index, :format => 'atom', :with_subprojects => 0,
|
||||||
|
:show_changesets => 1,
|
||||||
|
:show_documents => 1,
|
||||||
|
:show_files => 1,
|
||||||
|
:show_issues => 1,
|
||||||
|
:show_messages => 1,
|
||||||
|
:show_news => 1,
|
||||||
|
:show_time_entries => 1,
|
||||||
|
:show_wiki_edits => 1
|
||||||
|
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'common/feed.atom'
|
||||||
|
|
||||||
|
assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
|
||||||
|
:attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?show_changesets=1&show_documents=1&show_files=1&show_issues=1&show_messages=1&show_news=1&show_time_entries=1&show_wiki_edits=1&with_subprojects=0'}
|
||||||
|
assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil },
|
||||||
|
:attributes => {:rel => 'alternate', :href => 'http://test.host/activity?show_changesets=1&show_documents=1&show_files=1&show_issues=1&show_messages=1&show_news=1&show_time_entries=1&show_wiki_edits=1&with_subprojects=0'}
|
||||||
|
|
||||||
assert_tag :tag => 'entry', :child => {
|
assert_tag :tag => 'entry', :child => {
|
||||||
:tag => 'link',
|
:tag => 'link',
|
||||||
:attributes => {:href => 'http://test.host/issues/11'}}
|
:attributes => {:href => 'http://test.host/issues/11'}}
|
||||||
|
|
Loading…
Reference in New Issue