Commit 55ca66de authored by Yorick Peterse's avatar Yorick Peterse

Merge branch '6572-extract-ee-specific-files-lines-for-spec-features-admin' into 'master'

Resolve "Extract EE specific files/lines for spec/features/admin"

Closes #6572

See merge request gitlab-org/gitlab-ee!13378
parents 6586f6fc 3b3aeb04
......@@ -179,4 +179,29 @@ describe 'Admin updates EE-only settings' do
end
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
end
require 'spec_helper'
describe "Admin::Users" do
include Spec::Support::Helpers::Features::ResponsiveTableHelpers
let!(:user) do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end
let!(:current_user) { create(:admin, last_activity_on: 5.days.ago) }
before do
sign_in(current_user)
end
describe "GET /admin/users/:id" do
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
before do
visit admin_users_path
click_link "edit_user_#{user.id}"
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 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
end
......@@ -192,31 +192,6 @@ 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
......
......@@ -419,40 +419,6 @@ 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
......@@ -489,21 +455,6 @@ 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'
......@@ -516,19 +467,6 @@ 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
......
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