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:
authorClement Ho <ClemMakesApps@gmail.com>2018-05-08 18:49:30 +0300
committerClement Ho <ClemMakesApps@gmail.com>2018-05-08 18:49:30 +0300
commit5955caed321e242bfebe52a4b47346a01a50e4f6 (patch)
treed9710c0732ce21801b4a79a281bec0bd39582a95 /spec/features/admin
parentf9e2b4730f58ba630344c9554eb907ab003abbd5 (diff)
parent533593e95cd3a922a2ec2ea43b345862361dfd67 (diff)
Merge branch 'master' into bootstrap4
Diffstat (limited to 'spec/features/admin')
-rw-r--r--spec/features/admin/admin_runners_spec.rb41
-rw-r--r--spec/features/admin/admin_settings_spec.rb21
-rw-r--r--spec/features/admin/admin_users_spec.rb2
-rw-r--r--spec/features/admin/admin_uses_repository_checks_spec.rb2
4 files changed, 63 insertions, 3 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb
index 8de2e3d199b..3465ccfc423 100644
--- a/spec/features/admin/admin_runners_spec.rb
+++ b/spec/features/admin/admin_runners_spec.rb
@@ -59,6 +59,47 @@ describe "Admin Runners" do
expect(page).to have_text 'No runners found'
end
end
+
+ context 'group runner' do
+ let(:group) { create(:group) }
+ let!(:runner) { create(:ci_runner, groups: [group], runner_type: :group_type) }
+
+ it 'shows the label and does not show the project count' do
+ visit admin_runners_path
+
+ within "#runner_#{runner.id}" do
+ expect(page).to have_selector '.label', text: 'group'
+ expect(page).to have_text 'n/a'
+ end
+ end
+ end
+
+ context 'shared runner' do
+ it 'shows the label and does not show the project count' do
+ runner = create :ci_runner, :shared
+
+ visit admin_runners_path
+
+ within "#runner_#{runner.id}" do
+ expect(page).to have_selector '.label', text: 'shared'
+ expect(page).to have_text 'n/a'
+ end
+ end
+ end
+
+ context 'specific runner' do
+ it 'shows the label and the project count' do
+ project = create :project
+ runner = create :ci_runner, projects: [project]
+
+ visit admin_runners_path
+
+ within "#runner_#{runner.id}" do
+ expect(page).to have_selector '.label', text: 'specific'
+ expect(page).to have_text '1'
+ end
+ end
+ end
end
describe "Runner show page" do
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index 7853d2952ea..f2f9b734c39 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -2,10 +2,13 @@ require 'spec_helper'
feature 'Admin updates settings' do
include StubENV
+ include TermsHelper
+
+ let(:admin) { create(:admin) }
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
- sign_in(create(:admin))
+ sign_in(admin)
visit admin_application_settings_path
end
@@ -85,6 +88,22 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
+ scenario 'Terms of Service' do
+ # Already have the admin accept terms, so they don't need to accept in this spec.
+ _existing_terms = create(:term)
+ accept_terms(admin)
+
+ page.within('.as-terms') do
+ check 'Require all users to accept Terms of Service when they access GitLab.'
+ fill_in 'Terms of Service Agreement', with: 'Be nice!'
+ click_button 'Save changes'
+ end
+
+ expect(Gitlab::CurrentSettings.enforce_terms).to be(true)
+ expect(Gitlab::CurrentSettings.terms).to eq 'Be nice!'
+ expect(page).to have_content 'Application settings saved successfully'
+ end
+
scenario 'Modify oauth providers' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 9ec8bb0aefe..9e3221577c7 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -285,7 +285,7 @@ describe "Admin::Users" do
it "lists group projects" do
within(:css, '.append-bottom-default + .card') do
expect(page).to have_content 'Group projects'
- expect(page).to have_link group.name, admin_group_path(group)
+ expect(page).to have_link group.name, href: admin_group_path(group)
end
end
diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb
index f1ac73ff819..90cf5a53787 100644
--- a/spec/features/admin/admin_uses_repository_checks_spec.rb
+++ b/spec/features/admin/admin_uses_repository_checks_spec.rb
@@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do
expect(page).to have_content('Repository check was triggered')
end
- scenario 'to see a single failed repository check' do
+ scenario 'to see a single failed repository check', :js do
project = create(:project)
project.update_columns(
last_repository_check_failed: true,