Commit e6868abd authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'revert-763b34f7' into 'master'

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

See merge request gitlab-org/gitlab!26965
parents 74c8d9b7 8d5d6166
......@@ -33,7 +33,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def starred
@projects = load_projects(params.merge(starred: true))
.includes(:forked_from_project, :tags).page(params[:page])
.includes(:forked_from_project, :tags)
@groups = []
......@@ -51,7 +51,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
private
def projects
@projects ||= load_projects(params.merge(non_public: true)).page(params[:page])
@projects ||= load_projects(params.merge(non_public: true))
end
def render_projects
......@@ -73,6 +73,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
.execute
.includes(:route, :creator, :group, namespace: [:route, :owner])
.preload(:project_feature)
.page(finder_params[:page])
prepare_projects_for_rendering(projects)
end
......
---
title: Fix missing RSS feed events
merge_request: 19524
author:
type: fixed
......@@ -86,58 +86,11 @@ 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
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 '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
get :starred, format: :json
end
it 'does not paginate projects, even if page number is passed' do
get :index, format: :atom
expect(assigns(:events).count).to eq(2)
end
end
it { is_expected.to respond_with(:success) }
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