summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-04-13 02:42:03 +0000
committerGo MAEDA <maeda@farend.jp>2021-04-13 02:42:03 +0000
commitf446fc7bf2a914b3b40b7ac4bb420e3ca4482110 (patch)
treeaf296f35139e6a0f0701492269c1b3ae665ec0ac
parente7137af44318d0abec6d106b068fbe577dadfecb (diff)
downloadredmine-f446fc7bf2a914b3b40b7ac4bb420e3ca4482110.tar.gz
redmine-f446fc7bf2a914b3b40b7ac4bb420e3ca4482110.zip
Merged r20931 from trunk to 4.1-stable (#34933).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@20934 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/activities_controller.rb7
-rw-r--r--test/functional/activities_controller_test.rb16
2 files changed, 22 insertions, 1 deletions
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index d80924543..3120d63a5 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 8d6cc3aca..dbff6a82c 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -111,6 +111,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, :params => {
:format => 'atom',