diff options
author | Go MAEDA <maeda@farend.jp> | 2021-04-13 02:38:59 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-04-13 02:38:59 +0000 |
commit | f2798f9283402f044dca8845346c90d23313b85d (patch) | |
tree | 50f569e71ea34c6ac4f68416cccb3a77cd147b40 | |
parent | 528b6ecf288da4765d4e7a163287a7f69e8c6ad4 (diff) | |
download | redmine-f2798f9283402f044dca8845346c90d23313b85d.tar.gz redmine-f2798f9283402f044dca8845346c90d23313b85d.zip |
Merged r20931 from trunk to 4.2-stable (#34933).
git-svn-id: http://svn.redmine.org/redmine/branches/4.2-stable@20933 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/activities_controller.rb | 7 | ||||
-rw-r--r-- | test/functional/activities_controller_test.rb | 16 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index 5f522c831..cce17aef2 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -55,7 +55,12 @@ class ActivitiesController < ApplicationController end end - events = @activity.events(@date_from, @date_to) + events = + if params[:format] == 'atom' + @activity.events(nil, nil, :limit => Setting.feeds_limit.to_i) + else + @activity.events(@date_from, @date_to) + end if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language]) respond_to do |format| diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb index f004b6b74..6bc43da5e 100644 --- a/test/functional/activities_controller_test.rb +++ b/test/functional/activities_controller_test.rb @@ -125,6 +125,22 @@ class ActivitiesControllerTest < Redmine::ControllerTest end end + def test_index_atom_feed_should_respect_feeds_limit_setting + with_settings :feeds_limit => '20' do + get( + :index, + :params => { + :format => 'atom' + } + ) + end + assert_response :success + + assert_select 'feed' do + assert_select 'entry', :count => 20 + end + end + def test_index_atom_feed_with_explicit_selection get( :index, |