summaryrefslogtreecommitdiff
path: root/spec/features/groups
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/groups')
-rw-r--r--spec/features/groups/activity_spec.rb2
-rw-r--r--spec/features/groups/board_sidebar_spec.rb2
-rw-r--r--spec/features/groups/board_spec.rb2
-rw-r--r--spec/features/groups/clusters/applications_spec.rb2
-rw-r--r--spec/features/groups/clusters/eks_spec.rb2
-rw-r--r--spec/features/groups/clusters/user_spec.rb2
-rw-r--r--spec/features/groups/container_registry_spec.rb11
-rw-r--r--spec/features/groups/empty_states_spec.rb2
-rw-r--r--spec/features/groups/group_page_with_external_authorization_service_spec.rb2
-rw-r--r--spec/features/groups/group_settings_spec.rb2
-rw-r--r--spec/features/groups/import_export/export_file_spec.rb2
-rw-r--r--spec/features/groups/import_export/import_file_spec.rb104
-rw-r--r--spec/features/groups/issues_spec.rb2
-rw-r--r--spec/features/groups/labels/create_spec.rb2
-rw-r--r--spec/features/groups/labels/edit_spec.rb2
-rw-r--r--spec/features/groups/labels/index_spec.rb2
-rw-r--r--spec/features/groups/labels/search_labels_spec.rb2
-rw-r--r--spec/features/groups/labels/sort_labels_spec.rb2
-rw-r--r--spec/features/groups/labels/subscription_spec.rb2
-rw-r--r--spec/features/groups/labels/user_sees_links_to_issuables_spec.rb2
-rw-r--r--spec/features/groups/members/filter_members_spec.rb2
-rw-r--r--spec/features/groups/members/leave_group_spec.rb3
-rw-r--r--spec/features/groups/members/list_members_spec.rb2
-rw-r--r--spec/features/groups/members/manage_groups_spec.rb2
-rw-r--r--spec/features/groups/members/manage_members_spec.rb2
-rw-r--r--spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb2
-rw-r--r--spec/features/groups/members/master_manages_access_requests_spec.rb2
-rw-r--r--spec/features/groups/members/request_access_spec.rb2
-rw-r--r--spec/features/groups/members/search_members_spec.rb2
-rw-r--r--spec/features/groups/members/sort_members_spec.rb2
-rw-r--r--spec/features/groups/merge_requests_spec.rb2
-rw-r--r--spec/features/groups/milestone_spec.rb84
-rw-r--r--spec/features/groups/milestones_sorting_spec.rb19
-rw-r--r--spec/features/groups/navbar_spec.rb3
-rw-r--r--spec/features/groups/settings/ci_cd_spec.rb2
-rw-r--r--spec/features/groups/settings/group_badges_spec.rb2
-rw-r--r--spec/features/groups/settings/repository_spec.rb2
-rw-r--r--spec/features/groups/share_lock_spec.rb2
-rw-r--r--spec/features/groups/show_spec.rb2
-rw-r--r--spec/features/groups/user_browse_projects_group_page_spec.rb2
-rw-r--r--spec/features/groups/user_sees_package_sidebar_spec.rb2
-rw-r--r--spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb2
42 files changed, 178 insertions, 118 deletions
diff --git a/spec/features/groups/activity_spec.rb b/spec/features/groups/activity_spec.rb
index c102e19d477..6ca69e76d33 100644
--- a/spec/features/groups/activity_spec.rb
+++ b/spec/features/groups/activity_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group activity page' do
+RSpec.describe 'Group activity page' do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
let(:group) { create(:group) }
let(:path) { activity_group_path(group) }
diff --git a/spec/features/groups/board_sidebar_spec.rb b/spec/features/groups/board_sidebar_spec.rb
index ed874141ef4..3bbeed10948 100644
--- a/spec/features/groups/board_sidebar_spec.rb
+++ b/spec/features/groups/board_sidebar_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group Issue Boards', :js do
+RSpec.describe 'Group Issue Boards', :js do
include BoardHelpers
let(:group) { create(:group) }
diff --git a/spec/features/groups/board_spec.rb b/spec/features/groups/board_spec.rb
index f95e2e91cd7..29d0347086c 100644
--- a/spec/features/groups/board_spec.rb
+++ b/spec/features/groups/board_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group Boards' do
+RSpec.describe 'Group Boards' do
let(:group) { create(:group) }
let!(:project) { create(:project_empty_repo, group: group) }
let(:user) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
diff --git a/spec/features/groups/clusters/applications_spec.rb b/spec/features/groups/clusters/applications_spec.rb
index 5d48df234eb..324ef24efc4 100644
--- a/spec/features/groups/clusters/applications_spec.rb
+++ b/spec/features/groups/clusters/applications_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
require_relative '../../../../spec/features/clusters/installing_applications_shared_examples'
-describe 'Group-level Cluster Applications', :js do
+RSpec.describe 'Group-level Cluster Applications', :js do
include GoogleApi::CloudPlatformHelpers
let(:group) { create(:group) }
diff --git a/spec/features/groups/clusters/eks_spec.rb b/spec/features/groups/clusters/eks_spec.rb
index a9267d58739..5a62741250a 100644
--- a/spec/features/groups/clusters/eks_spec.rb
+++ b/spec/features/groups/clusters/eks_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group AWS EKS Cluster', :js do
+RSpec.describe 'Group AWS EKS Cluster', :js do
let(:group) { create(:group) }
let(:user) { create(:user) }
diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb
index a29afba99e4..c6e5da92160 100644
--- a/spec/features/groups/clusters/user_spec.rb
+++ b/spec/features/groups/clusters/user_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'User Cluster', :js do
+RSpec.describe 'User Cluster', :js do
include GoogleApi::CloudPlatformHelpers
let(:group) { create(:group) }
diff --git a/spec/features/groups/container_registry_spec.rb b/spec/features/groups/container_registry_spec.rb
index 7e3c1728f3c..87ef2131211 100644
--- a/spec/features/groups/container_registry_spec.rb
+++ b/spec/features/groups/container_registry_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Container Registry', :js do
+RSpec.describe 'Container Registry', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
@@ -24,6 +24,13 @@ describe 'Container Registry', :js do
expect(page).to have_title _('Container Registry')
end
+ it 'sidebar menu is open' do
+ visit_container_registry
+
+ sidebar = find('.nav-sidebar')
+ expect(sidebar).to have_link _('Container Registry')
+ end
+
context 'when there are no image repositories' do
it 'list page has no container title' do
visit_container_registry
@@ -75,7 +82,7 @@ describe 'Container Registry', :js do
expect(service).to receive(:execute).with(container_repository) { { status: :success } }
expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(container_repository.project, user, tags: ['latest']) { service }
- click_on(class: 'js-delete-registry')
+ first('[data-testid="singleDeleteButton"]').click
expect(find('.modal .modal-title')).to have_content _('Remove tag')
find('.modal .modal-footer .btn-danger').click
end
diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb
index bbc80b7eec4..d76cf993004 100644
--- a/spec/features/groups/empty_states_spec.rb
+++ b/spec/features/groups/empty_states_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group empty states' do
+RSpec.describe 'Group empty states' do
let(:group) { create(:group) }
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
diff --git a/spec/features/groups/group_page_with_external_authorization_service_spec.rb b/spec/features/groups/group_page_with_external_authorization_service_spec.rb
index a71b930d35f..8ef1b60d8ca 100644
--- a/spec/features/groups/group_page_with_external_authorization_service_spec.rb
+++ b/spec/features/groups/group_page_with_external_authorization_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'The group page' do
+RSpec.describe 'The group page' do
include ExternalAuthorizationServiceHelpers
let(:user) { create(:user) }
diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb
index d686e0ed9d2..8972be45acb 100644
--- a/spec/features/groups/group_settings_spec.rb
+++ b/spec/features/groups/group_settings_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Edit group settings' do
+RSpec.describe 'Edit group settings' do
let(:user) { create(:user) }
let(:group) { create(:group, path: 'foo') }
diff --git a/spec/features/groups/import_export/export_file_spec.rb b/spec/features/groups/import_export/export_file_spec.rb
index 5829e659722..9feb8085e66 100644
--- a/spec/features/groups/import_export/export_file_spec.rb
+++ b/spec/features/groups/import_export/export_file_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group Export', :js do
+RSpec.describe 'Group Export', :js do
include ExportFileHelper
let_it_be(:user) { create(:user) }
diff --git a/spec/features/groups/import_export/import_file_spec.rb b/spec/features/groups/import_export/import_file_spec.rb
new file mode 100644
index 00000000000..577198ef3f1
--- /dev/null
+++ b/spec/features/groups/import_export/import_file_spec.rb
@@ -0,0 +1,104 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'Import/Export - Group Import', :js do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:import_path) { "#{Dir.tmpdir}/group_import_spec" }
+
+ before do
+ allow_next_instance_of(Gitlab::ImportExport) do |import_export|
+ allow(import_export).to receive(:storage_path).and_return(import_path)
+ end
+
+ stub_uploads_object_storage(FileUploader)
+
+ gitlab_sign_in(user)
+ end
+
+ after do
+ FileUtils.rm_rf(import_path, secure: true)
+ end
+
+ context 'when the user uploads a valid export file' do
+ let(:file) { File.join(Rails.root, 'spec', %w[fixtures group_export.tar.gz]) }
+
+ context 'when using the pre-filled path', :sidekiq_inline do
+ it 'successfully imports the group' do
+ group_name = 'Test Group Import'
+
+ visit new_group_path
+
+ fill_in :group_name, with: group_name
+ find('#import-group-tab').click
+
+ expect(page).to have_content 'GitLab group export'
+ attach_file(file) do
+ find('.js-filepicker-button').click
+ end
+
+ expect { click_on 'Import group' }.to change { Group.count }.by 1
+
+ group = Group.find_by(name: group_name)
+
+ expect(group).not_to be_nil
+ expect(group.description).to eq 'A voluptate non sequi temporibus quam at.'
+ expect(group.path).to eq 'test-group-import'
+ expect(group.import_state.status).to eq GroupImportState.state_machine.states[:finished].value
+ end
+ end
+
+ context 'when modifying the pre-filled path' do
+ it 'successfully imports the group' do
+ visit new_group_path
+
+ fill_in :group_name, with: 'Test Group Import'
+ find('#import-group-tab').click
+
+ fill_in :import_group_path, with: 'custom-path'
+ attach_file(file) do
+ find('.js-filepicker-button').click
+ end
+
+ expect { click_on 'Import group' }.to change { Group.count }.by 1
+
+ group = Group.find_by(name: 'Test Group Import')
+ expect(group.path).to eq 'custom-path'
+ end
+ end
+
+ context 'when the path is already taken' do
+ before do
+ create(:group, path: 'test-group-import')
+ end
+
+ it 'suggests a unique path' do
+ visit new_group_path
+ find('#import-group-tab').click
+
+ fill_in :import_group_path, with: 'test-group-import'
+ expect(page).to have_content 'Group path is already taken. Suggestions: test-group-import1'
+ end
+ end
+ end
+
+ context 'when the user uploads an invalid export file' do
+ let(:file) { File.join(Rails.root, 'spec', %w[fixtures big-image.png]) }
+
+ it 'displays an error' do
+ visit new_group_path
+
+ fill_in :group_name, with: 'Test Group Import'
+ find('#import-group-tab').click
+ attach_file(file) do
+ find('.js-filepicker-button').click
+ end
+
+ expect { click_on 'Import group' }.not_to change { Group.count }
+
+ page.within('.flash-container') do
+ expect(page).to have_content('Unable to process group import file')
+ end
+ end
+ end
+end
diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb
index 1cefcd18989..c76e0c311a6 100644
--- a/spec/features/groups/issues_spec.rb
+++ b/spec/features/groups/issues_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group issues page' do
+RSpec.describe 'Group issues page' do
include FilteredSearchHelpers
include DragTo
diff --git a/spec/features/groups/labels/create_spec.rb b/spec/features/groups/labels/create_spec.rb
index f5062a65321..9c1a3672ebd 100644
--- a/spec/features/groups/labels/create_spec.rb
+++ b/spec/features/groups/labels/create_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Create a group label' do
+RSpec.describe 'Create a group label' do
let(:user) { create(:user) }
let(:group) { create(:group) }
diff --git a/spec/features/groups/labels/edit_spec.rb b/spec/features/groups/labels/edit_spec.rb
index 43f067b89d6..2be7f61eeb9 100644
--- a/spec/features/groups/labels/edit_spec.rb
+++ b/spec/features/groups/labels/edit_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Edit group label' do
+RSpec.describe 'Edit group label' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:label) { create(:group_label, group: group) }
diff --git a/spec/features/groups/labels/index_spec.rb b/spec/features/groups/labels/index_spec.rb
index 62308d3b518..3de29231f5c 100644
--- a/spec/features/groups/labels/index_spec.rb
+++ b/spec/features/groups/labels/index_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group labels' do
+RSpec.describe 'Group labels' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label) { create(:group_label, group: group) }
diff --git a/spec/features/groups/labels/search_labels_spec.rb b/spec/features/groups/labels/search_labels_spec.rb
index 14b88a561b1..fbb0acfb923 100644
--- a/spec/features/groups/labels/search_labels_spec.rb
+++ b/spec/features/groups/labels/search_labels_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Search for labels', :js do
+RSpec.describe 'Search for labels', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label1) { create(:group_label, title: 'Foo', description: 'Lorem ipsum', group: group) }
diff --git a/spec/features/groups/labels/sort_labels_spec.rb b/spec/features/groups/labels/sort_labels_spec.rb
index 2aea4d77675..b5657db23cb 100644
--- a/spec/features/groups/labels/sort_labels_spec.rb
+++ b/spec/features/groups/labels/sort_labels_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Sort labels', :js do
+RSpec.describe 'Sort labels', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label1) { create(:group_label, title: 'Foo', description: 'Lorem ipsum', group: group) }
diff --git a/spec/features/groups/labels/subscription_spec.rb b/spec/features/groups/labels/subscription_spec.rb
index cbccf4f3880..dedded777ac 100644
--- a/spec/features/groups/labels/subscription_spec.rb
+++ b/spec/features/groups/labels/subscription_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Labels subscription' do
+RSpec.describe 'Labels subscription' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label1) { create(:group_label, group: group, title: 'foo') }
diff --git a/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb b/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb
index 38561c71323..b0508633065 100644
--- a/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb
+++ b/spec/features/groups/labels/user_sees_links_to_issuables_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Labels > User sees links to issuables' do
+RSpec.describe 'Groups > Labels > User sees links to issuables' do
let_it_be(:group) { create(:group, :public) }
before do
diff --git a/spec/features/groups/members/filter_members_spec.rb b/spec/features/groups/members/filter_members_spec.rb
index cba86f7e651..643c8407578 100644
--- a/spec/features/groups/members/filter_members_spec.rb
+++ b/spec/features/groups/members/filter_members_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Filter members' do
+RSpec.describe 'Groups > Members > Filter members' do
let(:user) { create(:user) }
let(:nested_group_user) { create(:user) }
let(:user_with_2fa) { create(:user, :two_factor_via_otp) }
diff --git a/spec/features/groups/members/leave_group_spec.rb b/spec/features/groups/members/leave_group_spec.rb
index 5c7c83aea6d..fecc90f20c7 100644
--- a/spec/features/groups/members/leave_group_spec.rb
+++ b/spec/features/groups/members/leave_group_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Leave group' do
+RSpec.describe 'Groups > Members > Leave group' do
let(:user) { create(:user) }
let(:other_user) { create(:user) }
let(:group) { create(:group) }
@@ -31,6 +31,7 @@ describe 'Groups > Members > Leave group' do
page.accept_confirm
+ wait_for_all_requests
expect(current_path).to eq(dashboard_groups_path)
expect(group.users).not_to include(user)
end
diff --git a/spec/features/groups/members/list_members_spec.rb b/spec/features/groups/members/list_members_spec.rb
index 8df807186be..415c6927320 100644
--- a/spec/features/groups/members/list_members_spec.rb
+++ b/spec/features/groups/members/list_members_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > List members' do
+RSpec.describe 'Groups > Members > List members' do
include Select2Helper
include Spec::Support::Helpers::Features::ListRowsHelpers
diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb
index 593c450c6d6..f1cf04417c0 100644
--- a/spec/features/groups/members/manage_groups_spec.rb
+++ b/spec/features/groups/members/manage_groups_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Manage groups', :js do
+RSpec.describe 'Groups > Members > Manage groups', :js do
include Select2Helper
include Spec::Support::Helpers::Features::ListRowsHelpers
diff --git a/spec/features/groups/members/manage_members_spec.rb b/spec/features/groups/members/manage_members_spec.rb
index e4ba3022d8b..e29d8fd651e 100644
--- a/spec/features/groups/members/manage_members_spec.rb
+++ b/spec/features/groups/members/manage_members_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Manage members' do
+RSpec.describe 'Groups > Members > Manage members' do
include Select2Helper
include Spec::Support::Helpers::Features::ListRowsHelpers
diff --git a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb
index 491937ce4ab..f80925186ed 100644
--- a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb
+++ b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Owner adds member with expiration date', :js do
+RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js do
include Select2Helper
include ActiveSupport::Testing::TimeHelpers
diff --git a/spec/features/groups/members/master_manages_access_requests_spec.rb b/spec/features/groups/members/master_manages_access_requests_spec.rb
index 1c13bd3d59e..2a17e7d2a5c 100644
--- a/spec/features/groups/members/master_manages_access_requests_spec.rb
+++ b/spec/features/groups/members/master_manages_access_requests_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Maintainer manages access requests' do
+RSpec.describe 'Groups > Members > Maintainer manages access requests' do
it_behaves_like 'Maintainer manages access requests' do
let(:entity) { create(:group, :public) }
let(:members_page_path) { group_group_members_path(entity) }
diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb
index 5f22af3529c..307cb63ec8e 100644
--- a/spec/features/groups/members/request_access_spec.rb
+++ b/spec/features/groups/members/request_access_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Request access' do
+RSpec.describe 'Groups > Members > Request access' do
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:group) { create(:group, :public) }
diff --git a/spec/features/groups/members/search_members_spec.rb b/spec/features/groups/members/search_members_spec.rb
index fda129ce422..4c34ccf87c3 100644
--- a/spec/features/groups/members/search_members_spec.rb
+++ b/spec/features/groups/members/search_members_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Search group member' do
+RSpec.describe 'Search group member' do
let(:user) { create :user }
let(:member) { create :user }
diff --git a/spec/features/groups/members/sort_members_spec.rb b/spec/features/groups/members/sort_members_spec.rb
index 76709199942..cfc0e421aeb 100644
--- a/spec/features/groups/members/sort_members_spec.rb
+++ b/spec/features/groups/members/sort_members_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > Members > Sort members' do
+RSpec.describe 'Groups > Members > Sort members' do
let(:owner) { create(:user, name: 'John Doe') }
let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) }
let(:group) { create(:group) }
diff --git a/spec/features/groups/merge_requests_spec.rb b/spec/features/groups/merge_requests_spec.rb
index f87fa10e2f4..43d4b6b23e0 100644
--- a/spec/features/groups/merge_requests_spec.rb
+++ b/spec/features/groups/merge_requests_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group merge requests page' do
+RSpec.describe 'Group merge requests page' do
include FilteredSearchHelpers
let(:path) { merge_requests_group_path(group) }
diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb
index 65ef0af5be3..2217bd9d6b5 100644
--- a/spec/features/groups/milestone_spec.rb
+++ b/spec/features/groups/milestone_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group milestones' do
+RSpec.describe 'Group milestones' do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project_empty_repo, group: group) }
let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
@@ -102,11 +102,9 @@ describe 'Group milestones' do
expect(find('.top-area .all .badge').text).to eq("6")
end
- it 'lists legacy group milestones and group milestones' do
- legacy_milestone = GroupMilestone.build_collection(group, group.projects, { state: 'active' }).first
-
+ it 'lists group and project milestones' do
expect(page).to have_selector("#milestone_#{active_group_milestone.id}", count: 1)
- expect(page).to have_selector("#milestone_#{legacy_milestone.milestone.id}", count: 1)
+ expect(page).to have_selector("#milestone_#{active_project_milestone2.id}", count: 1)
end
it 'shows milestone detail and supports its edit' do
@@ -126,74 +124,34 @@ describe 'Group milestones' do
expect(page).to have_content('v1.1')
expect(page).to have_content('GL-113')
expect(page).to have_link(
+ 'v1.0',
+ href: project_milestone_path(project, active_project_milestone1)
+ )
+ expect(page).to have_link(
'1 Issue',
- href: issues_group_path(group, milestone_title: 'v1.0')
+ href: project_issues_path(project, milestone_title: 'v1.0')
)
expect(page).to have_link(
'0 Merge Requests',
- href: merge_requests_group_path(group, milestone_title: 'v1.0')
+ href: project_merge_requests_path(project, milestone_title: 'v1.0')
+ )
+ expect(page).to have_link(
+ 'GL-113',
+ href: group_milestone_path(group, active_group_milestone)
+ )
+ expect(page).to have_link(
+ '0 Issues',
+ href: issues_group_path(group, milestone_title: 'GL-113')
+ )
+ expect(page).to have_link(
+ '0 Merge Requests',
+ href: merge_requests_group_path(group, milestone_title: 'GL-113')
)
- end
-
- it 'renders group milestone details' do
- click_link 'v1.0'
-
- expect(page).to have_content('expires on Aug 20, 2114')
- expect(page).to have_content('v1.0')
- expect(page).to have_content('Issues 1 Open: 1 Closed: 0')
- expect(page).to have_link(issue.title, href: project_issue_path(issue.project, issue))
end
end
end
describe 'milestone tabs', :js do
- context 'for a legacy group milestone' do
- let_it_be(:milestone) { create(:milestone, project: project) }
- let_it_be(:label) { create(:label, project: project) }
- let_it_be(:issue) { create(:labeled_issue, project: project, milestone: milestone, labels: [label], assignees: [create(:user)]) }
- let_it_be(:mr) { create(:merge_request, source_project: project, milestone: milestone) }
-
- before do
- visit group_milestone_path(group, milestone.title, title: milestone.title)
- end
-
- it 'renders the issues tab' do
- within('#tab-issues') do
- expect(page).to have_content issue.title
- end
- end
-
- it 'renders the merge requests tab' do
- within('.js-milestone-tabs') do
- click_link('Merge Requests')
- end
-
- within('#tab-merge-requests') do
- expect(page).to have_content mr.title
- end
- end
-
- it 'renders the participants tab' do
- within('.js-milestone-tabs') do
- click_link('Participants')
- end
-
- within('#tab-participants') do
- expect(page).to have_content issue.assignees.first.name
- end
- end
-
- it 'renders the labels tab' do
- within('.js-milestone-tabs') do
- click_link('Labels')
- end
-
- within('#tab-labels') do
- expect(page).to have_content label.title
- end
- end
- end
-
context 'for a group milestone' do
let_it_be(:other_project) { create(:project_empty_repo, group: group) }
let_it_be(:milestone) { create(:milestone, group: group) }
diff --git a/spec/features/groups/milestones_sorting_spec.rb b/spec/features/groups/milestones_sorting_spec.rb
index d27511be0b0..a06e64fdee0 100644
--- a/spec/features/groups/milestones_sorting_spec.rb
+++ b/spec/features/groups/milestones_sorting_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Milestones sorting', :js do
+RSpec.describe 'Milestones sorting', :js do
let(:group) { create(:group) }
let!(:project) { create(:project_empty_repo, group: group) }
let!(:other_project) { create(:project_empty_repo, group: group) }
@@ -24,21 +24,12 @@ describe 'Milestones sorting', :js do
# assert default sorting
within '.milestones' do
- expect(page.all('ul.content-list > li').first.text).to include('v2.0')
- expect(page.all('ul.content-list > li')[1].text).to include('v3.0')
- expect(page.all('ul.content-list > li').last.text).to include('v1.0')
+ expect(page.all('ul.content-list > li strong > a').map(&:text)).to eq(['v2.0', 'v2.0', 'v3.0', 'v1.0', 'v1.0'])
end
click_button 'Due soon'
- sort_options = find('ul.dropdown-menu-sort li').all('a').collect(&:text)
-
- expect(sort_options[0]).to eq('Due soon')
- expect(sort_options[1]).to eq('Due later')
- expect(sort_options[2]).to eq('Start soon')
- expect(sort_options[3]).to eq('Start later')
- expect(sort_options[4]).to eq('Name, ascending')
- expect(sort_options[5]).to eq('Name, descending')
+ expect(find('ul.dropdown-menu-sort li').all('a').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending'])
click_link 'Due later'
@@ -46,9 +37,7 @@ describe 'Milestones sorting', :js do
# assert descending sorting
within '.milestones' do
- expect(page.all('ul.content-list > li').first.text).to include('v1.0')
- expect(page.all('ul.content-list > li')[1].text).to include('v3.0')
- expect(page.all('ul.content-list > li').last.text).to include('v2.0')
+ expect(page.all('ul.content-list > li strong > a').map(&:text)).to eq(['v1.0', 'v1.0', 'v3.0', 'v2.0', 'v2.0'])
end
end
end
diff --git a/spec/features/groups/navbar_spec.rb b/spec/features/groups/navbar_spec.rb
index fd5b4ec9345..cfa1f3338a1 100644
--- a/spec/features/groups/navbar_spec.rb
+++ b/spec/features/groups/navbar_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group navbar' do
+RSpec.describe 'Group navbar' do
include NavbarStructureHelper
include_context 'group navbar structure'
@@ -46,6 +46,7 @@ describe 'Group navbar' do
before do
stub_feature_flags(group_push_rules: false)
+ stub_feature_flags(group_iterations: false)
group.add_maintainer(user)
sign_in(user)
end
diff --git a/spec/features/groups/settings/ci_cd_spec.rb b/spec/features/groups/settings/ci_cd_spec.rb
index 5b1a9512c55..9c2f9512b9d 100644
--- a/spec/features/groups/settings/ci_cd_spec.rb
+++ b/spec/features/groups/settings/ci_cd_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group CI/CD settings' do
+RSpec.describe 'Group CI/CD settings' do
include WaitForRequests
let(:user) { create(:user) }
diff --git a/spec/features/groups/settings/group_badges_spec.rb b/spec/features/groups/settings/group_badges_spec.rb
index 72e74df368b..5bf736cc7ce 100644
--- a/spec/features/groups/settings/group_badges_spec.rb
+++ b/spec/features/groups/settings/group_badges_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group Badges' do
+RSpec.describe 'Group Badges' do
include WaitForRequests
let(:user) { create(:user) }
diff --git a/spec/features/groups/settings/repository_spec.rb b/spec/features/groups/settings/repository_spec.rb
index 722fd98ce59..d20303027e5 100644
--- a/spec/features/groups/settings/repository_spec.rb
+++ b/spec/features/groups/settings/repository_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group Repository settings' do
+RSpec.describe 'Group Repository settings' do
include WaitForRequests
let(:user) { create(:user) }
diff --git a/spec/features/groups/share_lock_spec.rb b/spec/features/groups/share_lock_spec.rb
index 777f5d98720..d8207899e24 100644
--- a/spec/features/groups/share_lock_spec.rb
+++ b/spec/features/groups/share_lock_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group share with group lock' do
+RSpec.describe 'Group share with group lock' do
let(:root_owner) { create(:user) }
let(:root_group) { create(:group) }
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index bcaed2a5f18..ec30f34199d 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Group show page' do
+RSpec.describe 'Group show page' do
let(:group) { create(:group) }
let(:path) { group_path(group) }
diff --git a/spec/features/groups/user_browse_projects_group_page_spec.rb b/spec/features/groups/user_browse_projects_group_page_spec.rb
index 68221e3fefe..999449a94b0 100644
--- a/spec/features/groups/user_browse_projects_group_page_spec.rb
+++ b/spec/features/groups/user_browse_projects_group_page_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'User browse group projects page' do
+RSpec.describe 'User browse group projects page' do
let(:user) { create :user }
let(:group) { create :group }
diff --git a/spec/features/groups/user_sees_package_sidebar_spec.rb b/spec/features/groups/user_sees_package_sidebar_spec.rb
index f85b6841636..ee216488232 100644
--- a/spec/features/groups/user_sees_package_sidebar_spec.rb
+++ b/spec/features/groups/user_sees_package_sidebar_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > sidebar' do
+RSpec.describe 'Groups > sidebar' do
let(:user) { create(:user) }
let(:group) { create(:group) }
diff --git a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb
index 742021ae4a1..9fe11070187 100644
--- a/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb
+++ b/spec/features/groups/user_sees_users_dropdowns_in_issuables_list_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Groups > User sees users dropdowns in issuables list' do
+RSpec.describe 'Groups > User sees users dropdowns in issuables list' do
let(:entity) { create(:group) }
let(:user_in_dropdown) { create(:user) }
let!(:user_not_in_dropdown) { create(:user) }