From: Go MAEDA Date: Mon, 14 Dec 2020 01:25:34 +0000 (+0000) Subject: Atom feed on project with subprojects should show in article title the name of the... X-Git-Tag: 4.2.0~171 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=36274a95e9bd06a7e2d8b1a10c4238e9bb8106c2;p=redmine.git Atom feed on project with subprojects should show in article title the name of the project (#15212). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@20648 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builder index d7f4c8b00..0fbe1063c 100644 --- a/app/views/common/feed.atom.builder +++ b/app/views/common/feed.atom.builder @@ -36,7 +36,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do @items.each do |item| xml.entry do url = url_for(item.event_url(:only_path => false, :protocol => protocol, :host => host)) - if @project + if @project == item.project xml.title truncate_single_line_raw(item.event_title, 100) else xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 100) diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb index 29fca5cda..7475d4996 100644 --- a/test/functional/activities_controller_test.rb +++ b/test/functional/activities_controller_test.rb @@ -181,6 +181,26 @@ class ActivitiesControllerTest < Redmine::ControllerTest assert_select 'title', :text => "Redmine: #{User.find(2).name}" end + def test_index_atom_feed_with_subprojects + get( + :index, + :params => { + :format => 'atom', + :id => 'ecookbook', + :with_subprojects => 1, + :show_issues => 1 + } + ) + assert_response :success + + assert_select 'feed' do + # eCookbook + assert_select 'title', text: 'Bug #1: Cannot print recipes' + # eCookbook Subproject 1 + assert_select 'title', text: 'eCookbook Subproject 1 - Bug #5 (New): Subproject issue' + end + end + def test_index_should_show_private_notes_with_permission_only journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes', :private_notes => true) @request.session[:user_id] = 2