Skip to content
Snippets Groups Projects
Commit 1ce5bcac authored by Heinrich Lee Yu's avatar Heinrich Lee Yu :basketball:
Browse files

Remove code related to object hierarchy in MySQL

These are not required because MySQL is not
supported anymore
parent ba997f3c
No related branches found
No related tags found
No related merge requests found
Showing
with 34 additions and 68 deletions
Loading
Loading
@@ -85,7 +85,7 @@ describe Boards::IssuesController do
expect { list_issues(user: user, board: group_board, list: list3) }.not_to exceed_query_limit(control_count + (2 * 8 - 1))
end
 
it 'avoids N+1 database queries when adding a subgroup, project, and issue', :nested_groups do
it 'avoids N+1 database queries when adding a subgroup, project, and issue' do
create(:project, group: sub_group_1)
create(:labeled_issue, project: project, labels: [development])
control_count = ActiveRecord::QueryRecorder.new { list_issues(user: user, board: group_board, list: list3) }.count
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@ describe GroupTree do
expect(assigns(:groups)).to contain_exactly(other_group)
end
 
context 'for subgroups', :nested_groups do
context 'for subgroups' do
it 'only renders root groups when no parent was given' do
create(:group, :public, parent: group)
 
Loading
Loading
@@ -85,7 +85,7 @@ describe GroupTree do
expect(json_response.first['id']).to eq(group.id)
end
 
context 'nested groups', :nested_groups do
context 'nested groups' do
it 'expands the tree when filtering' do
subgroup = create(:group, :public, parent: group, name: 'filter')
 
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ describe Dashboard::GroupsController do
expect(assigns(:groups)).to contain_exactly(member_of_group)
end
 
context 'when rendering an expanded hierarchy with public groups you are not a member of', :nested_groups do
context 'when rendering an expanded hierarchy with public groups you are not a member of' do
let!(:top_level_result) { create(:group, name: 'chef-top') }
let!(:top_level_a) { create(:group, name: 'top-a') }
let!(:sub_level_result_a) { create(:group, name: 'chef-sub-a', parent: top_level_a) }
Loading
Loading
Loading
Loading
@@ -46,7 +46,7 @@ describe Groups::ChildrenController do
end
end
 
context 'for subgroups', :nested_groups do
context 'for subgroups' do
let!(:public_subgroup) { create(:group, :public, parent: group) }
let!(:private_subgroup) { create(:group, :private, parent: group) }
let!(:public_project) { create(:project, :public, namespace: group) }
Loading
Loading
@@ -292,7 +292,7 @@ describe Groups::ChildrenController do
end
end
 
context 'with subgroups and projects', :nested_groups do
context 'with subgroups and projects' do
let!(:first_page_subgroups) { create_list(:group, per_page, :public, parent: group) }
let!(:other_subgroup) { create(:group, :public, parent: group) }
let!(:next_page_projects) { create_list(:project, per_page, :public, namespace: group) }
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ describe Groups::LabelsController do
expect(label_ids).to match_array([label_1.title, group_label_1.title])
end
 
context 'with ancestor group', :nested_groups do
context 'with ancestor group' do
set(:subgroup) { create(:group, parent: group) }
set(:subgroup_label_1) { create(:group_label, group: subgroup, title: 'subgroup_label_1') }
 
Loading
Loading
@@ -32,7 +32,7 @@ describe Groups::LabelsController do
subgroup.add_owner(user)
end
 
it 'returns ancestor group labels', :nested_groups do
it 'returns ancestor group labels' do
get :index, params: { group_id: subgroup, include_ancestor_groups: true, only_group_labels: true }, format: :json
 
label_ids = json_response.map {|label| label['title']}
Loading
Loading
Loading
Loading
@@ -89,7 +89,7 @@ describe GroupsController do
end
 
describe 'GET #new' do
context 'when creating subgroups', :nested_groups do
context 'when creating subgroups' do
[true, false].each do |can_create_group_status|
context "and can_create_group is #{can_create_group_status}" do
before do
Loading
Loading
@@ -166,7 +166,7 @@ describe GroupsController do
end
end
 
context 'when creating subgroups', :nested_groups do
context 'when creating subgroups' do
[true, false].each do |can_create_group_status|
context "and can_create_group is #{can_create_group_status}" do
context 'and logged in as Owner' do
Loading
Loading
@@ -584,7 +584,7 @@ describe GroupsController do
end
end
 
describe 'PUT transfer', :postgresql do
describe 'PUT transfer' do
before do
sign_in(user)
end
Loading
Loading
Loading
Loading
@@ -231,7 +231,7 @@ describe Import::BitbucketController do
end
end
 
context 'user has chosen an existing nested namespace and name for the project', :postgresql do
context 'user has chosen an existing nested namespace and name for the project' do
let(:parent_namespace) { create(:group, name: 'foo') }
let(:nested_namespace) { create(:group, name: 'bar', parent: parent_namespace) }
let(:test_name) { 'test_name' }
Loading
Loading
@@ -250,7 +250,7 @@ describe Import::BitbucketController do
end
end
 
context 'user has chosen a non-existent nested namespaces and name for the project', :postgresql do
context 'user has chosen a non-existent nested namespaces and name for the project' do
let(:test_name) { 'test_name' }
 
it 'takes the selected namespace and name' do
Loading
Loading
@@ -281,7 +281,7 @@ describe Import::BitbucketController do
end
end
 
context 'user has chosen existent and non-existent nested namespaces and name for the project', :postgresql do
context 'user has chosen existent and non-existent nested namespaces and name for the project' do
let(:test_name) { 'test_name' }
let!(:parent_namespace) { create(:group, name: 'foo') }
 
Loading
Loading
Loading
Loading
@@ -197,7 +197,7 @@ describe Import::GitlabController do
end
end
 
context 'user has chosen an existing nested namespace for the project', :postgresql do
context 'user has chosen an existing nested namespace for the project' do
let(:parent_namespace) { create(:group, name: 'foo') }
let(:nested_namespace) { create(:group, name: 'bar', parent: parent_namespace) }
 
Loading
Loading
@@ -215,7 +215,7 @@ describe Import::GitlabController do
end
end
 
context 'user has chosen a non-existent nested namespaces for the project', :postgresql do
context 'user has chosen a non-existent nested namespaces for the project' do
let(:test_name) { 'test_name' }
 
it 'takes the selected namespace and name' do
Loading
Loading
@@ -246,7 +246,7 @@ describe Import::GitlabController do
end
end
 
context 'user has chosen existent and non-existent nested namespaces and name for the project', :postgresql do
context 'user has chosen existent and non-existent nested namespaces and name for the project' do
let(:test_name) { 'test_name' }
let!(:parent_namespace) { create(:group, name: 'foo') }
 
Loading
Loading
Loading
Loading
@@ -115,7 +115,7 @@ describe Projects::MilestonesController do
end
end
 
context 'with nested groups', :nested_groups do
context 'with nested groups' do
let!(:subgroup) { create(:group, :public, parent: group) }
let!(:subgroup_milestone) { create(:milestone, group: subgroup) }
 
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ describe 'Dashboard Groups page', :js do
expect(page).not_to have_content(another_group.name)
end
 
it 'shows subgroups the user is member of', :nested_groups do
it 'shows subgroups the user is member of' do
group.add_owner(user)
nested_group.add_owner(user)
 
Loading
Loading
@@ -40,7 +40,7 @@ describe 'Dashboard Groups page', :js do
expect(page).to have_content(nested_group.name)
end
 
context 'when filtering groups', :nested_groups do
context 'when filtering groups' do
before do
group.add_owner(user)
nested_group.add_owner(user)
Loading
Loading
@@ -79,7 +79,7 @@ describe 'Dashboard Groups page', :js do
end
end
 
context 'with subgroups', :nested_groups do
context 'with subgroups' do
let!(:subgroup) { create(:group, :public, parent: group) }
 
before do
Loading
Loading
Loading
Loading
@@ -110,7 +110,7 @@ describe 'Group empty states' do
end
 
context 'group without a project' do
context 'group has a subgroup', :nested_groups do
context 'group has a subgroup' do
let(:subgroup) { create(:group, parent: group) }
let(:subgroup_project) { create(:project, namespace: subgroup) }
 
Loading
Loading
Loading
Loading
@@ -121,7 +121,7 @@ describe 'Edit group settings' do
expect(find(:css, '.group-root-path').text).to eq(root_url)
end
 
it 'has a parent group URL label for a subgroup group', :postgresql do
it 'has a parent group URL label for a subgroup group' do
subgroup = create(:group, parent: group)
 
visit edit_group_path(subgroup)
Loading
Loading
Loading
Loading
@@ -50,7 +50,7 @@ describe 'Group issues page' do
end
end
 
context 'issues list', :nested_groups do
context 'issues list' do
let(:subgroup) { create(:group, parent: group) }
let(:subgroup_project) { create(:project, :public, group: subgroup)}
let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ describe 'Groups > Members > List members' do
sign_in(user1)
end
 
it 'show members from current group and parent', :nested_groups do
it 'show members from current group and parent' do
group.add_developer(user1)
nested_group.add_developer(user2)
 
Loading
Loading
@@ -23,7 +23,7 @@ describe 'Groups > Members > List members' do
expect(second_row.text).to include(user2.name)
end
 
it 'show user once if member of both current group and parent', :nested_groups do
it 'show user once if member of both current group and parent' do
group.add_developer(user1)
nested_group.add_developer(user1)
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe 'Group share with group lock' do
sign_in(root_owner)
end
 
context 'with a subgroup', :nested_groups do
context 'with a subgroup' do
let!(:subgroup) { create(:group, parent: root_group) }
 
context 'when enabling the parent group share with group lock' do
Loading
Loading
Loading
Loading
@@ -75,11 +75,7 @@ describe 'Group show page' do
sign_in(owner)
end
 
context 'when subgroups are supported', :nested_groups do
before do
allow(Group).to receive(:supports_nested_objects?) { true }
end
context 'when subgroups are supported' do
it 'allows creating subgroups' do
visit path
 
Loading
Loading
@@ -87,19 +83,6 @@ describe 'Group show page' do
.to have_css("li[data-text='New subgroup']", visible: false)
end
end
context 'when subgroups are not supported' do
before do
allow(Group).to receive(:supports_nested_objects?) { false }
end
it 'does not allow creating subgroups' do
visit path
expect(page)
.not_to have_selector("li[data-text='New subgroup']", visible: false)
end
end
end
 
context 'for maintainers' do
Loading
Loading
@@ -107,11 +90,7 @@ describe 'Group show page' do
sign_in(maintainer)
end
 
context 'when subgroups are supported', :nested_groups do
before do
allow(Group).to receive(:supports_nested_objects?) { true }
end
context 'when subgroups are supported' do
context 'when subgroup_creation_level is set to maintainers' do
before do
relaxed_group.add_maintainer(maintainer)
Loading
Loading
@@ -141,19 +120,6 @@ describe 'Group show page' do
end
end
end
context 'when subgroups are not supported' do
before do
allow(Group).to receive(:supports_nested_objects?) { false }
end
it 'does not allow creating subgroups' do
visit path
expect(page)
.not_to have_selector("li[data-text='New subgroup']", visible: false)
end
end
end
end
 
Loading
Loading
Loading
Loading
@@ -105,7 +105,7 @@ describe 'Group' do
end
end
 
describe 'create a nested group', :nested_groups, :js do
describe 'create a nested group', :js do
let(:group) { create(:group, path: 'foo') }
 
context 'as admin' do
Loading
Loading
@@ -231,7 +231,7 @@ describe 'Group' do
end
end
 
describe 'group page with nested groups', :nested_groups, :js do
describe 'group page with nested groups', :js do
let!(:group) { create(:group) }
let!(:nested_group) { create(:group, parent: group) }
let!(:project) { create(:project, namespace: group) }
Loading
Loading
require 'spec_helper'
 
describe 'IDE', :js do
describe 'sub-groups', :nested_groups do
describe 'sub-groups' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:subgroup) { create(:group, parent: group) }
Loading
Loading
require 'spec_helper'
 
describe 'Import multiple repositories by uploading a manifest file', :js, :postgresql do
describe 'Import multiple repositories by uploading a manifest file', :js do
include Select2Helper
 
let(:user) { create(:admin) }
Loading
Loading
require 'spec_helper'
 
describe 'Labels Hierarchy', :js, :nested_groups do
describe 'Labels Hierarchy', :js do
include FilteredSearchHelpers
 
let!(:user) { create(:user) }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment