Project

General

Profile

Defect #34933 » 34933.patch

Yuichi HARADA, 2021-03-19 06:48

View differences:

app/controllers/activities_controller.rb
55 55
      end
56 56
    end
57 57

  
58
    events = @activity.events(@date_from, @date_to)
58
    events =
59
      if params[:format] == 'atom'
60
        @activity.events(nil, nil, :limit => Setting.feeds_limit.to_i)
61
      else
62
        @activity.events(@date_from, @date_to)
63
      end
59 64

  
60 65
    if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
61 66
      respond_to do |format|
test/functional/activities_controller_test.rb
125 125
    end
126 126
  end
127 127

  
128
  def test_index_atom_feed_should_receive_entries_with_number_of_setting
129
    with_settings :feeds_limit => '20' do
130
      get(
131
        :index,
132
        :params => {
133
          :format => 'atom'
134
        }
135
      )
136
    end
137
    assert_response :success
138

  
139
    assert_select 'feed' do
140
      assert_select 'entry', :count => 20
141
    end
142
  end
143

  
128 144
  def test_index_atom_feed_with_explicit_selection
129 145
    get(
130 146
      :index,
(1-1/2)