Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e11053d0
Commit
e11053d0
authored
Sep 05, 2018
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
be41338b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
spec/features/admin/admin_settings_spec.rb
spec/features/admin/admin_settings_spec.rb
+47
-2
No files found.
spec/features/admin/admin_settings_spec.rb
View file @
e11053d0
...
@@ -9,10 +9,11 @@ describe 'Admin updates settings' do
...
@@ -9,10 +9,11 @@ describe 'Admin updates settings' do
before
do
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
sign_in
(
admin
)
sign_in
(
admin
)
visit
admin_application_settings_path
end
end
it
'Change visibility settings'
do
it
'Change visibility settings'
do
visit
admin_application_settings_path
page
.
within
(
'.as-visibility-access'
)
do
page
.
within
(
'.as-visibility-access'
)
do
choose
"application_setting_default_project_visibility_20"
choose
"application_setting_default_project_visibility_20"
click_button
'Save changes'
click_button
'Save changes'
...
@@ -22,6 +23,8 @@ describe 'Admin updates settings' do
...
@@ -22,6 +23,8 @@ describe 'Admin updates settings' do
end
end
it
'Uncheck all restricted visibility levels'
do
it
'Uncheck all restricted visibility levels'
do
visit
admin_application_settings_path
page
.
within
(
'.as-visibility-access'
)
do
page
.
within
(
'.as-visibility-access'
)
do
find
(
'#application_setting_visibility_level_0'
).
set
(
false
)
find
(
'#application_setting_visibility_level_0'
).
set
(
false
)
find
(
'#application_setting_visibility_level_10'
).
set
(
false
)
find
(
'#application_setting_visibility_level_10'
).
set
(
false
)
...
@@ -36,6 +39,8 @@ describe 'Admin updates settings' do
...
@@ -36,6 +39,8 @@ describe 'Admin updates settings' do
end
end
it
'Modify import sources'
do
it
'Modify import sources'
do
visit
admin_application_settings_path
expect
(
Gitlab
::
CurrentSettings
.
import_sources
).
not_to
be_empty
expect
(
Gitlab
::
CurrentSettings
.
import_sources
).
not_to
be_empty
page
.
within
(
'.as-visibility-access'
)
do
page
.
within
(
'.as-visibility-access'
)
do
...
@@ -59,6 +64,8 @@ describe 'Admin updates settings' do
...
@@ -59,6 +64,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Visibility and Access Controls'
do
it
'Change Visibility and Access Controls'
do
visit
admin_application_settings_path
page
.
within
(
'.as-visibility-access'
)
do
page
.
within
(
'.as-visibility-access'
)
do
uncheck
'Project export enabled'
uncheck
'Project export enabled'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -69,6 +76,8 @@ describe 'Admin updates settings' do
...
@@ -69,6 +76,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Account and Limit Settings'
do
it
'Change Account and Limit Settings'
do
visit
admin_application_settings_path
page
.
within
(
'.as-account-limit'
)
do
page
.
within
(
'.as-account-limit'
)
do
uncheck
'Gravatar enabled'
uncheck
'Gravatar enabled'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -79,6 +88,8 @@ describe 'Admin updates settings' do
...
@@ -79,6 +88,8 @@ describe 'Admin updates settings' do
end
end
it
'Change New users set to external'
,
:js
do
it
'Change New users set to external'
,
:js
do
visit
admin_application_settings_path
user_internal_regex
=
find
(
'#application_setting_user_default_internal_regex'
,
visible: :all
)
user_internal_regex
=
find
(
'#application_setting_user_default_internal_regex'
,
visible: :all
)
expect
(
user_internal_regex
).
to
be_readonly
expect
(
user_internal_regex
).
to
be_readonly
...
@@ -91,6 +102,8 @@ describe 'Admin updates settings' do
...
@@ -91,6 +102,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Sign-in restrictions'
do
it
'Change Sign-in restrictions'
do
visit
admin_application_settings_path
page
.
within
(
'.as-signin'
)
do
page
.
within
(
'.as-signin'
)
do
fill_in
'Home page URL'
,
with:
'https://about.gitlab.com/'
fill_in
'Home page URL'
,
with:
'https://about.gitlab.com/'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -101,6 +114,8 @@ describe 'Admin updates settings' do
...
@@ -101,6 +114,8 @@ describe 'Admin updates settings' do
end
end
it
'Terms of Service'
do
it
'Terms of Service'
do
visit
admin_application_settings_path
# Already have the admin accept terms, so they don't need to accept in this spec.
# Already have the admin accept terms, so they don't need to accept in this spec.
_existing_terms
=
create
(
:term
)
_existing_terms
=
create
(
:term
)
accept_terms
(
admin
)
accept_terms
(
admin
)
...
@@ -117,6 +132,8 @@ describe 'Admin updates settings' do
...
@@ -117,6 +132,8 @@ describe 'Admin updates settings' do
end
end
it
'Modify oauth providers'
do
it
'Modify oauth providers'
do
visit
admin_application_settings_path
expect
(
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
).
to
be_empty
expect
(
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
).
to
be_empty
page
.
within
(
'.as-signin'
)
do
page
.
within
(
'.as-signin'
)
do
...
@@ -137,6 +154,8 @@ describe 'Admin updates settings' do
...
@@ -137,6 +154,8 @@ describe 'Admin updates settings' do
end
end
it
'Oauth providers do not raise validation errors when saving unrelated changes'
do
it
'Oauth providers do not raise validation errors when saving unrelated changes'
do
visit
admin_application_settings_path
expect
(
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
).
to
be_empty
expect
(
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
).
to
be_empty
page
.
within
(
'.as-signin'
)
do
page
.
within
(
'.as-signin'
)
do
...
@@ -151,7 +170,7 @@ describe 'Admin updates settings' do
...
@@ -151,7 +170,7 @@ describe 'Admin updates settings' do
allow
(
Devise
).
to
receive
(
:omniauth_providers
).
and_return
([])
allow
(
Devise
).
to
receive
(
:omniauth_providers
).
and_return
([])
# Save an unrelated setting
# Save an unrelated setting
page
.
within
(
'.as-
ci-cd
'
)
do
page
.
within
(
'.as-
terms
'
)
do
click_button
'Save changes'
click_button
'Save changes'
end
end
...
@@ -160,6 +179,8 @@ describe 'Admin updates settings' do
...
@@ -160,6 +179,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Help page'
do
it
'Change Help page'
do
visit
preferences_admin_application_settings_path
page
.
within
(
'.as-help-page'
)
do
page
.
within
(
'.as-help-page'
)
do
fill_in
'Help page text'
,
with:
'Example text'
fill_in
'Help page text'
,
with:
'Example text'
check
'Hide marketing-related entries from help'
check
'Hide marketing-related entries from help'
...
@@ -174,6 +195,8 @@ describe 'Admin updates settings' do
...
@@ -174,6 +195,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Pages settings'
do
it
'Change Pages settings'
do
visit
preferences_admin_application_settings_path
page
.
within
(
'.as-pages'
)
do
page
.
within
(
'.as-pages'
)
do
fill_in
'Maximum size of pages (MB)'
,
with:
15
fill_in
'Maximum size of pages (MB)'
,
with:
15
check
'Require users to prove ownership of custom domains'
check
'Require users to prove ownership of custom domains'
...
@@ -186,6 +209,8 @@ describe 'Admin updates settings' do
...
@@ -186,6 +209,8 @@ describe 'Admin updates settings' do
end
end
it
'Change CI/CD settings'
do
it
'Change CI/CD settings'
do
visit
ci_cd_admin_application_settings_path
page
.
within
(
'.as-ci-cd'
)
do
page
.
within
(
'.as-ci-cd'
)
do
check
'Default to Auto DevOps pipeline for all projects'
check
'Default to Auto DevOps pipeline for all projects'
fill_in
'Auto devops domain'
,
with:
'domain.com'
fill_in
'Auto devops domain'
,
with:
'domain.com'
...
@@ -198,6 +223,8 @@ describe 'Admin updates settings' do
...
@@ -198,6 +223,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Influx settings'
do
it
'Change Influx settings'
do
visit
metrics_and_profiling_admin_application_settings_path
page
.
within
(
'.as-influx'
)
do
page
.
within
(
'.as-influx'
)
do
check
'Enable InfluxDB Metrics'
check
'Enable InfluxDB Metrics'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -208,6 +235,8 @@ describe 'Admin updates settings' do
...
@@ -208,6 +235,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Prometheus settings'
do
it
'Change Prometheus settings'
do
visit
metrics_and_profiling_admin_application_settings_path
page
.
within
(
'.as-prometheus'
)
do
page
.
within
(
'.as-prometheus'
)
do
check
'Enable Prometheus Metrics'
check
'Enable Prometheus Metrics'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -218,6 +247,8 @@ describe 'Admin updates settings' do
...
@@ -218,6 +247,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Performance bar settings'
do
it
'Change Performance bar settings'
do
visit
metrics_and_profiling_admin_application_settings_path
group
=
create
(
:group
)
group
=
create
(
:group
)
page
.
within
(
'.as-performance-bar'
)
do
page
.
within
(
'.as-performance-bar'
)
do
...
@@ -241,6 +272,8 @@ describe 'Admin updates settings' do
...
@@ -241,6 +272,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Background jobs settings'
do
it
'Change Background jobs settings'
do
visit
preferences_admin_application_settings_path
page
.
within
(
'.as-background'
)
do
page
.
within
(
'.as-background'
)
do
fill_in
'Throttling Factor'
,
with:
1
fill_in
'Throttling Factor'
,
with:
1
click_button
'Save changes'
click_button
'Save changes'
...
@@ -251,6 +284,8 @@ describe 'Admin updates settings' do
...
@@ -251,6 +284,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Spam settings'
do
it
'Change Spam settings'
do
visit
reporting_admin_application_settings_path
page
.
within
(
'.as-spam'
)
do
page
.
within
(
'.as-spam'
)
do
check
'Enable reCAPTCHA'
check
'Enable reCAPTCHA'
fill_in
'reCAPTCHA Site Key'
,
with:
'key'
fill_in
'reCAPTCHA Site Key'
,
with:
'key'
...
@@ -265,6 +300,8 @@ describe 'Admin updates settings' do
...
@@ -265,6 +300,8 @@ describe 'Admin updates settings' do
end
end
it
'Configure web terminal'
do
it
'Configure web terminal'
do
visit
admin_application_settings_path
page
.
within
(
'.as-terminal'
)
do
page
.
within
(
'.as-terminal'
)
do
fill_in
'Max session time'
,
with:
15
fill_in
'Max session time'
,
with:
15
click_button
'Save changes'
click_button
'Save changes'
...
@@ -275,6 +312,8 @@ describe 'Admin updates settings' do
...
@@ -275,6 +312,8 @@ describe 'Admin updates settings' do
end
end
it
'Enable outbound requests'
do
it
'Enable outbound requests'
do
visit
network_admin_application_settings_path
page
.
within
(
'.as-outbound'
)
do
page
.
within
(
'.as-outbound'
)
do
check
'Allow requests to the local network from hooks and services'
check
'Allow requests to the local network from hooks and services'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -285,6 +324,8 @@ describe 'Admin updates settings' do
...
@@ -285,6 +324,8 @@ describe 'Admin updates settings' do
end
end
it
'Enable hiding third party offers'
do
it
'Enable hiding third party offers'
do
visit
integrations_admin_application_settings_path
page
.
within
(
'.as-third-party-offers'
)
do
page
.
within
(
'.as-third-party-offers'
)
do
check
'Do not display offers from third parties within GitLab'
check
'Do not display offers from third parties within GitLab'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -295,6 +336,8 @@ describe 'Admin updates settings' do
...
@@ -295,6 +336,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Slack Notifications Service template settings'
do
it
'Change Slack Notifications Service template settings'
do
visit
integrations_admin_application_settings_path
first
(
:link
,
'Service Templates'
).
click
first
(
:link
,
'Service Templates'
).
click
click_link
'Slack notifications'
click_link
'Slack notifications'
fill_in
'Webhook'
,
with:
'http://localhost'
fill_in
'Webhook'
,
with:
'http://localhost'
...
@@ -319,6 +362,8 @@ describe 'Admin updates settings' do
...
@@ -319,6 +362,8 @@ describe 'Admin updates settings' do
end
end
it
'Change Keys settings'
do
it
'Change Keys settings'
do
visit
admin_application_settings_path
page
.
within
(
'.as-visibility-access'
)
do
page
.
within
(
'.as-visibility-access'
)
do
select
'Are forbidden'
,
from:
'RSA SSH keys'
select
'Are forbidden'
,
from:
'RSA SSH keys'
select
'Are allowed'
,
from:
'DSA SSH keys'
select
'Are allowed'
,
from:
'DSA SSH keys'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment