Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/features/admin
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/features/admin')
-rw-r--r--spec/features/admin/admin_projects_spec.rb97
-rw-r--r--spec/features/admin/admin_settings_spec.rb15
-rw-r--r--spec/features/admin/dashboard_spec.rb10
3 files changed, 45 insertions, 77 deletions
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb
index aab2e6d7cef..bf280595ec7 100644
--- a/spec/features/admin/admin_projects_spec.rb
+++ b/spec/features/admin/admin_projects_spec.rb
@@ -92,97 +92,46 @@ RSpec.describe "Admin::Projects" do
end
end
- context 'when `vue_project_members_list` feature flag is enabled', :js do
- describe 'admin adds themselves to the project' do
- before do
- project.add_maintainer(user)
- stub_feature_flags(invite_members_group_modal: false)
- end
-
- it 'adds admin to the project as developer', :js do
- visit project_project_members_path(project)
-
- page.within '.invite-users-form' do
- select2(current_user.id, from: '#user_ids', multiple: true)
- select 'Developer', from: 'access_level'
- end
-
- click_button 'Invite'
-
- expect(find_member_row(current_user)).to have_content('Developer')
- end
+ describe 'admin adds themselves to the project', :js do
+ before do
+ project.add_maintainer(user)
+ stub_feature_flags(invite_members_group_modal: false)
end
- describe 'admin removes themselves from the project' do
- before do
- project.add_maintainer(user)
- project.add_developer(current_user)
- end
-
- it 'removes admin from the project' do
- visit project_project_members_path(project)
-
- expect(find_member_row(current_user)).to have_content('Developer')
+ it 'adds admin to the project as developer' do
+ visit project_project_members_path(project)
- page.within find_member_row(current_user) do
- click_button 'Leave'
- end
+ page.within '.invite-users-form' do
+ select2(current_user.id, from: '#user_ids', multiple: true)
+ select 'Developer', from: 'access_level'
+ end
- page.within('[role="dialog"]') do
- click_button('Leave')
- end
+ click_button 'Invite'
- expect(current_path).to match dashboard_projects_path
- end
+ expect(find_member_row(current_user)).to have_content('Developer')
end
end
- context 'when `vue_project_members_list` feature flag is disabled' do
+ describe 'admin removes themselves from the project', :js do
before do
- stub_feature_flags(vue_project_members_list: false)
+ project.add_maintainer(user)
+ project.add_developer(current_user)
end
- describe 'admin adds themselves to the project' do
- before do
- project.add_maintainer(user)
- stub_feature_flags(invite_members_group_modal: false)
- end
-
- it 'adds admin to the project as developer', :js do
- visit project_project_members_path(project)
-
- page.within '.invite-users-form' do
- select2(current_user.id, from: '#user_ids', multiple: true)
- select 'Developer', from: 'access_level'
- end
+ it 'removes admin from the project' do
+ visit project_project_members_path(project)
- click_button 'Invite'
+ expect(find_member_row(current_user)).to have_content('Developer')
- page.within '.content-list' do
- expect(page).to have_content(current_user.name)
- expect(page).to have_content('Developer')
- end
+ page.within find_member_row(current_user) do
+ click_button 'Leave'
end
- end
- describe 'admin removes themselves from the project' do
- before do
- project.add_maintainer(user)
- project.add_developer(current_user)
+ page.within('[role="dialog"]') do
+ click_button('Leave')
end
- it 'removes admin from the project' do
- visit project_project_members_path(project)
-
- page.within '.content-list' do
- expect(page).to have_content(current_user.name)
- expect(page).to have_content('Developer')
- end
-
- find(:css, '.content-list li', text: current_user.name).find(:css, 'a.btn-danger').click
-
- expect(page).not_to have_selector(:css, '.content-list')
- end
+ expect(current_path).to match dashboard_projects_path
end
end
end
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index 52f39f65bd0..249621f5835 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -384,7 +384,20 @@ RSpec.describe 'Admin updates settings' do
click_button 'Save changes'
end
- expect(current_settings.repository_storages_weighted_default).to be 50
+ expect(current_settings.repository_storages_weighted).to eq('default' => 50)
+ end
+
+ it 'still saves when settings are outdated' do
+ current_settings.update_attribute :repository_storages_weighted, { 'default' => 100, 'outdated' => 100 }
+
+ visit repository_admin_application_settings_path
+
+ page.within('.as-repository-storage') do
+ fill_in 'application_setting_repository_storages_weighted_default', with: 50
+ click_button 'Save changes'
+ end
+
+ expect(current_settings.repository_storages_weighted).to eq('default' => 50)
end
end
diff --git a/spec/features/admin/dashboard_spec.rb b/spec/features/admin/dashboard_spec.rb
index c040811ada1..618fae3e46b 100644
--- a/spec/features/admin/dashboard_spec.rb
+++ b/spec/features/admin/dashboard_spec.rb
@@ -30,7 +30,6 @@ RSpec.describe 'admin visits dashboard' do
describe 'Users statistic' do
let_it_be(:users_statistics) { create(:users_statistics) }
- let_it_be(:users_count_label) { Gitlab.ee? ? 'Billable users 71' : 'Active users 71' }
it 'shows correct amounts of users', :aggregate_failures do
visit admin_dashboard_stats_path
@@ -42,9 +41,16 @@ RSpec.describe 'admin visits dashboard' do
expect(page).to have_content('Users with highest role Maintainer 6')
expect(page).to have_content('Users with highest role Owner 5')
expect(page).to have_content('Bots 2')
+
+ if Gitlab.ee?
+ expect(page).to have_content('Billable users 69')
+ else
+ expect(page).not_to have_content('Billable users 69')
+ end
+
expect(page).to have_content('Blocked users 7')
expect(page).to have_content('Total users 78')
- expect(page).to have_content(users_count_label)
+ expect(page).to have_content('Active users 71')
end
end
end