mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-21 07:51:12 +00:00
Revert r19810 (#10535).
git-svn-id: http://svn.redmine.org/redmine/trunk@20685 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
87d2fa498d
commit
843f13f7e2
@ -1,12 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
protocol = Setting.protocol
|
|
||||||
host = Setting.host_name
|
|
||||||
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_raw(@title, 100)
|
xml.title truncate_single_line_raw(@title, 100)
|
||||||
xml.link "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom', :protocol => protocol, :host => host)
|
xml.link "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom')
|
||||||
xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false, :protocol => protocol, :host => host)
|
xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false)
|
||||||
xml.id home_url
|
xml.id home_url
|
||||||
xml.icon favicon_url
|
xml.icon favicon_url
|
||||||
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
|
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
|
||||||
@ -14,7 +12,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
|||||||
xml.generator(:uri => Redmine::Info.url) {xml.text! Redmine::Info.app_name}
|
xml.generator(:uri => Redmine::Info.url) {xml.text! Redmine::Info.app_name}
|
||||||
@items.each do |item|
|
@items.each do |item|
|
||||||
xml.entry do
|
xml.entry do
|
||||||
url = url_for(item.event_url(:only_path => false, :protocol => protocol, :host => host))
|
url = url_for(item.event_url(:only_path => false))
|
||||||
if @project == item.project
|
if @project == item.project
|
||||||
xml.title truncate_single_line_raw(item.event_title, 100)
|
xml.title truncate_single_line_raw(item.event_title, 100)
|
||||||
else
|
else
|
||||||
|
|||||||
@ -106,7 +106,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_index_atom_feed
|
def test_index_atom_feed
|
||||||
with_settings :protocol => 'http', :host_name => 'redmine.test' do
|
|
||||||
get(
|
get(
|
||||||
:index,
|
:index,
|
||||||
:params => {
|
:params => {
|
||||||
@ -114,20 +113,18 @@ class ActivitiesControllerTest < Redmine::ControllerTest
|
|||||||
:with_subprojects => 0
|
:with_subprojects => 0
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
assert_select 'feed' do
|
assert_select 'feed' do
|
||||||
assert_select 'link[rel=self][href=?]', 'http://redmine.test/activity.atom?with_subprojects=0'
|
assert_select 'link[rel=self][href=?]', 'http://test.host/activity.atom?with_subprojects=0'
|
||||||
assert_select 'link[rel=alternate][href=?]', 'http://redmine.test/activity?with_subprojects=0'
|
assert_select 'link[rel=alternate][href=?]', 'http://test.host/activity?with_subprojects=0'
|
||||||
assert_select 'entry' do
|
assert_select 'entry' do
|
||||||
assert_select 'link[href=?]', 'http://redmine.test/issues/11'
|
assert_select 'link[href=?]', 'http://test.host/issues/11'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_index_atom_feed_with_explicit_selection
|
def test_index_atom_feed_with_explicit_selection
|
||||||
with_settings :protocol => 'https', :host_name => 'redmine.example' do
|
|
||||||
get(
|
get(
|
||||||
:index,
|
:index,
|
||||||
:params => {
|
:params => {
|
||||||
@ -143,14 +140,13 @@ class ActivitiesControllerTest < Redmine::ControllerTest
|
|||||||
:show_wiki_edits => 1
|
:show_wiki_edits => 1
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
assert_select 'feed' do
|
assert_select 'feed' do
|
||||||
assert_select 'link[rel=self][href=?]', 'https://redmine.example/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_select 'link[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_select 'link[rel=alternate][href=?]', 'https://redmine.example/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_select 'link[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_select 'entry' do
|
assert_select 'entry' do
|
||||||
assert_select 'link[href=?]', 'https://redmine.example/issues/11'
|
assert_select 'link[href=?]', 'http://test.host/issues/11'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1140,7 +1140,6 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_index_atom
|
def test_index_atom
|
||||||
with_settings :protocol => 'https', :host_name => 'example.net' do
|
|
||||||
get(
|
get(
|
||||||
:index,
|
:index,
|
||||||
:params => {
|
:params => {
|
||||||
@ -1148,14 +1147,13 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
:format => 'atom'
|
:format => 'atom'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'application/atom+xml', response.media_type
|
assert_equal 'application/atom+xml', response.media_type
|
||||||
|
|
||||||
assert_select 'feed' do
|
assert_select 'feed' do
|
||||||
assert_select 'link[rel=self][href=?]', 'https://example.net/projects/ecookbook/issues.atom'
|
assert_select 'link[rel=self][href=?]', 'http://test.host/projects/ecookbook/issues.atom'
|
||||||
assert_select 'link[rel=alternate][href=?]', 'https://example.net/projects/ecookbook/issues'
|
assert_select 'link[rel=alternate][href=?]', 'http://test.host/projects/ecookbook/issues'
|
||||||
assert_select 'entry link[href=?]', 'https://example.net/issues/1'
|
assert_select 'entry link[href=?]', 'http://test.host/issues/1'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user