Commit f79ec5e6 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'fix-project-controller-event-feed' into 'master'

Fix project controller event feed

Closes #29990 and #24227

See merge request gitlab-org/gitlab!28054
parents 03f7822c 8a985043
......@@ -87,7 +87,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
def load_events
projects = load_projects(params.merge(non_public: true))
projects = ProjectsFinder
.new(params: params.merge(non_public: true), current_user: current_user)
.execute
@events = EventCollection
.new(projects, offset: params[:offset].to_i, filter: event_filter)
......
---
title: Fix missing RSS feed events
merge_request: 19524
author:
type: fixed
......@@ -86,11 +86,58 @@ describe Dashboard::ProjectsController do
end
describe 'GET /starred.json' do
subject { get :starred, format: :json }
let(:projects) { create_list(:project, 2, creator: user) }
before do
get :starred, format: :json
allow(Kaminari.config).to receive(:default_per_page).and_return(1)
projects.each do |project|
project.add_developer(user)
create(:users_star_project, project_id: project.id, user_id: user.id)
end
end
it { is_expected.to respond_with(:success) }
it 'returns success' do
subject
expect(response).to have_gitlab_http_status(:ok)
end
it 'paginates the records' do
subject
expect(assigns(:projects).count).to eq(1)
end
end
end
context 'atom requests' do
let(:user) { create(:user) }
before do
sign_in(user)
end
describe '#index' do
context 'project pagination' do
let(:projects) { create_list(:project, 2, creator: user) }
before do
allow(Kaminari.config).to receive(:default_per_page).and_return(1)
projects.each do |project|
project.add_developer(user)
end
end
it 'does not paginate projects, even if normally restricted by pagination' do
get :index, format: :atom
expect(assigns(:events).count).to eq(2)
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment