Extract EE specific files/lines for spec/features/admin
We have the following files containing EE specific code. We should move them to ee/
spec/features/admin/admin_settings_spec.rb
diff --git a/spec/features/admin/admin_settings_spec.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/features/admin/admin_settings_spec.rb
index 04f39b807d7..aafeb1817cf 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/features/admin/admin_settings_spec.rb
@@ -192,6 +192,31 @@ describe 'Admin updates settings' do
end
end
+ describe 'LDAP settings' do
+ context 'with LDAP enabled' do
+ it 'Change allow group owners to manage ldap' do
+ allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(true)
+ visit admin_application_settings_path
+
+ page.within('.as-visibility-access') do
+ find('#application_setting_allow_group_owners_to_manage_ldap').set(false)
+ click_button 'Save'
+ end
+
+ expect(page).to have_content('Application settings saved successfully')
+ expect(find('#application_setting_allow_group_owners_to_manage_ldap')).not_to be_checked
+ end
+ end
+
+ context 'with LDAP disabled' do
+ it 'Does not show option to allow group owners to manage ldap' do
+ visit admin_application_settings_path
+
+ expect(page).not_to have_css('#application_setting_allow_group_owners_to_manage_ldap')
+ end
+ end
+ end
+
context 'Integrations page' do
before do
visit integrations_admin_application_settings_path
spec/features/admin/admin_users_spec.rb
diff --git a/spec/features/admin/admin_users_spec.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/features/admin/admin_users_spec.rb
index b1c6f308bc6..92dd3e3721a 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/features/admin/admin_users_spec.rb
@@ -422,6 +422,40 @@ describe "Admin::Users" do
end
end
end
+
+ describe 'Shared runners quota status' do
+ before do
+ user.namespace.update(shared_runners_minutes_limit: 500)
+ end
+
+ context 'with projects with shared runners enabled' do
+ before do
+ create(:project, namespace: user.namespace, shared_runners_enabled: true)
+ end
+
+ it 'shows quota' do
+ visit admin_users_path
+
+ click_link user.name
+
+ expect(page).to have_content('Pipeline minutes quota: 0 / 500')
+ end
+ end
+
+ context 'without projects with shared runners enabled' do
+ before do
+ create(:project, namespace: user.namespace, shared_runners_enabled: false)
+ end
+
+ it 'does not show quota' do
+ visit admin_users_path
+
+ click_link user.name
+
+ expect(page).not_to have_content('Pipeline minutes quota:')
+ end
+ end
+ end
end
describe "GET /admin/users/:id/edit" do
@@ -458,6 +492,21 @@ describe "Admin::Users" do
end
end
+ describe "Update user account type" do
+ before do
+ allow_any_instance_of(AuditorUserHelper).to receive(:license_allows_auditor_user?).and_return(true)
+ choose "user_access_level_auditor"
+ click_button "Save changes"
+ end
+
+ it "changes account type to be auditor" do
+ user.reload
+
+ expect(user).not_to be_admin
+ expect(user).to be_auditor
+ end
+ end
+
describe 'update username to non ascii char' do
it do
fill_in 'user_username', with: '\u3042\u3044'
@@ -470,6 +519,19 @@ describe "Admin::Users" do
expect(page).to have_selector(%(form[action="/admin/users/#{user.username}"]))
end
end
+
+ describe 'Update shared runners quota' do
+ let!(:project) { create(:project, namespace: user.namespace, shared_runners_enabled: true) }
+
+ before do
+ fill_in "user_namespace_attributes_shared_runners_minutes_limit", with: "500"
+ click_button "Save changes"
+ end
+
+ it "shows page with new data" do
+ expect(page).to have_content('Pipeline minutes quota: 0 / 500')
+ end
+ end
end
describe "GET /admin/users/:id/projects" do
Edited by Yorick Peterse