Commit 35f275c4 authored by Jan Beckmann's avatar Jan Beckmann Committed by Rémy Coutable

Add extra blank lines, use with_issues_available_for_user

parent ac457742
...@@ -67,7 +67,7 @@ module API ...@@ -67,7 +67,7 @@ module API
def find_group_projects(params) def find_group_projects(params)
group = find_group!(params[:id]) group = find_group!(params[:id])
projects = GroupProjectsFinder.new(group: group, current_user: current_user, params: project_finder_params).execute projects = GroupProjectsFinder.new(group: group, current_user: current_user, params: project_finder_params).execute
projects = projects.with_issues_enabled if params[:with_issues_enabled] projects = projects.with_issues_available_for_user(current_user) if params[:with_issues_enabled]
projects = projects.with_merge_requests_enabled if params[:with_merge_requests_enabled] projects = projects.with_merge_requests_enabled if params[:with_merge_requests_enabled]
projects = reorder_projects(projects) projects = reorder_projects(projects)
paginate(projects) paginate(projects)
......
...@@ -110,9 +110,11 @@ feature 'Group empty states' do ...@@ -110,9 +110,11 @@ feature 'Group empty states' do
context 'group has only a project with issues disabled' do context 'group has only a project with issues disabled' do
let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled, group: group) } let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled, group: group) }
before do before do
visit path visit path
end end
it_behaves_like "no projects" it_behaves_like "no projects"
end end
end end
......
...@@ -81,11 +81,13 @@ feature 'Group issues page' do ...@@ -81,11 +81,13 @@ feature 'Group issues page' do
context 'projects with issues disabled' do context 'projects with issues disabled' do
describe 'issue dropdown' do describe 'issue dropdown' do
let(:user_in_group) { create(:group_member, :master, user: create(:user), group: group ).user } let(:user_in_group) { create(:group_member, :master, user: create(:user), group: group ).user }
before do before do
[project, project_with_issues_disabled].each { |project| project.add_master(user_in_group) } [project, project_with_issues_disabled].each { |project| project.add_master(user_in_group) }
sign_in(user_in_group) sign_in(user_in_group)
visit issues_group_path(group) visit issues_group_path(group)
end end
it 'shows projects only with issues feature enabled', :js do it 'shows projects only with issues feature enabled', :js do
find('.new-project-item-link').click find('.new-project-item-link').click
......
...@@ -59,6 +59,7 @@ feature 'Group merge requests page' do ...@@ -59,6 +59,7 @@ feature 'Group merge requests page' do
describe 'new merge request dropdown' do describe 'new merge request dropdown' do
let(:project_with_merge_requests_disabled) { create(:project, :merge_requests_disabled, group: group) } let(:project_with_merge_requests_disabled) { create(:project, :merge_requests_disabled, group: group) }
before do before do
visit path visit path
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