diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-30 15:45:23 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-30 17:04:22 -0800 |
commit | 30e6cfa05a361cbdc12ddb7c12061f4c7221c61b (patch) | |
tree | 7564b6be9e610563c5905c34113268c0e4d1d60b /spec/controllers/groups_controller_spec.rb | |
parent | 120c79020ddd3097ae64149c75864353276aaa5f (diff) | |
download | gitlab-ce-30e6cfa05a361cbdc12ddb7c12061f4c7221c61b.tar.gz |
Fix not all events being shown in group dashboardsh-fix-events-collection
The group activity feed was limited to the first 20 projects found
in the group, which caused activity from some projects to be omitted.
A limit of 20 is applied to the query for events, so the
extra pagination does little in the way of performance.
Closes #42560
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index a9cfd964dd5..492fed42d31 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -85,6 +85,30 @@ describe GroupsController do end end + describe 'GET #activity' do + render_views + + before do + sign_in(user) + project + end + + context 'as json' do + it 'includes all projects in event feed' do + 3.times do + project = create(:project, group: group) + create(:event, project: project) + end + + get :activity, id: group.to_param, format: :json + + expect(response).to have_gitlab_http_status(200) + expect(json_response['count']).to eq(3) + expect(assigns(:projects).limit_value).to be_nil + end + end + end + describe 'POST #create' do context 'when creating subgroups', :nested_groups do [true, false].each do |can_create_group_status| |