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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
7e55a227
Commit
7e55a227
authored
Feb 19, 2019
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'use_gitlab_current_settings' into 'master'"
This reverts merge request !25370
parent
61b606a8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/validators/url_validator.rb
app/validators/url_validator.rb
+1
-1
spec/lib/gitlab/current_settings_spec.rb
spec/lib/gitlab/current_settings_spec.rb
+4
-3
spec/models/lfs_download_object_spec.rb
spec/models/lfs_download_object_spec.rb
+3
-1
No files found.
app/validators/url_validator.rb
View file @
7e55a227
...
@@ -93,6 +93,6 @@ class UrlValidator < ActiveModel::EachValidator
...
@@ -93,6 +93,6 @@ class UrlValidator < ActiveModel::EachValidator
end
end
def
allow_setting_local_requests?
def
allow_setting_local_requests?
Gitlab
::
CurrentSettings
.
allow_local_requests_from_hooks_and_services?
ApplicationSetting
.
current
&
.
allow_local_requests_from_hooks_and_services?
end
end
end
end
spec/lib/gitlab/current_settings_spec.rb
View file @
7e55a227
...
@@ -14,8 +14,9 @@ describe Gitlab::CurrentSettings do
...
@@ -14,8 +14,9 @@ describe Gitlab::CurrentSettings do
describe
'#current_application_settings'
,
:use_clean_rails_memory_store_caching
do
describe
'#current_application_settings'
,
:use_clean_rails_memory_store_caching
do
it
'allows keys to be called directly'
do
it
'allows keys to be called directly'
do
db_settings
=
ApplicationSetting
.
first
||
create
(
:application_setting
)
db_settings
=
create
(
:application_setting
,
db_settings
.
update!
(
home_page_url:
'http://mydomain.com'
,
signup_enabled:
false
)
home_page_url:
'http://mydomain.com'
,
signup_enabled:
false
)
expect
(
described_class
.
home_page_url
).
to
eq
(
db_settings
.
home_page_url
)
expect
(
described_class
.
home_page_url
).
to
eq
(
db_settings
.
home_page_url
)
expect
(
described_class
.
signup_enabled?
).
to
be_falsey
expect
(
described_class
.
signup_enabled?
).
to
be_falsey
...
@@ -108,7 +109,7 @@ describe Gitlab::CurrentSettings do
...
@@ -108,7 +109,7 @@ describe Gitlab::CurrentSettings do
context
'with pending migrations'
do
context
'with pending migrations'
do
before
do
before
do
allow
(
ActiveRecord
::
Migrator
).
to
receive
(
:needs_migration?
).
and_return
(
true
)
expect
(
ActiveRecord
::
Migrator
).
to
receive
(
:needs_migration?
).
and_return
(
true
)
end
end
shared_examples
'a non-persisted ApplicationSetting object'
do
shared_examples
'a non-persisted ApplicationSetting object'
do
...
...
spec/models/lfs_download_object_spec.rb
View file @
7e55a227
...
@@ -46,7 +46,9 @@ describe LfsDownloadObject do
...
@@ -46,7 +46,9 @@ describe LfsDownloadObject do
subject
{
described_class
.
new
(
oid:
oid
,
size:
size
,
link:
'http://192.168.1.1'
)
}
subject
{
described_class
.
new
(
oid:
oid
,
size:
size
,
link:
'http://192.168.1.1'
)
}
before
do
before
do
stub_application_setting
(
allow_local_requests_from_hooks_and_services:
setting
)
allow
(
ApplicationSetting
)
.
to
receive
(
:current
)
.
and_return
(
ApplicationSetting
.
build_from_defaults
(
allow_local_requests_from_hooks_and_services:
setting
))
end
end
context
'are allowed'
do
context
'are allowed'
do
...
...
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