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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f86ff1b8
Commit
f86ff1b8
authored
Feb 09, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/max-attachment-size-setting-validation'
parents
706b101f
dd3b9fea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
CHANGELOG
CHANGELOG
+1
-0
app/models/application_setting.rb
app/models/application_setting.rb
+4
-0
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+8
-0
No files found.
CHANGELOG
View file @
f86ff1b8
...
...
@@ -44,6 +44,7 @@ v 8.5.0 (unreleased)
- Fix: init.d script not working on OS X
- Faster snippet search
- Title for milestones should be unique (Zeger-Jan van de Weg)
- Validate correctness of maximum attachment size application setting
v 8.4.4
- Update omniauth-saml gem to 1.4.2
...
...
app/models/application_setting.rb
View file @
f86ff1b8
...
...
@@ -93,6 +93,10 @@ class ApplicationSetting < ActiveRecord::Base
presence:
true
,
if: :akismet_enabled
validates
:max_attachment_size
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates_each
:restricted_visibility_levels
do
|
record
,
attr
,
value
|
unless
value
.
nil?
value
.
each
do
|
level
|
...
...
spec/models/application_setting_spec.rb
View file @
f86ff1b8
...
...
@@ -66,6 +66,14 @@ describe ApplicationSetting, models: true do
it
{
is_expected
.
to
allow_value
(
http
).
for
(
:after_sign_out_path
)
}
it
{
is_expected
.
to
allow_value
(
https
).
for
(
:after_sign_out_path
)
}
it
{
is_expected
.
not_to
allow_value
(
ftp
).
for
(
:after_sign_out_path
)
}
it
{
is_expected
.
to
validate_presence_of
(
:max_attachment_size
)
}
it
do
is_expected
.
to
validate_numericality_of
(
:max_attachment_size
)
.
only_integer
.
is_greater_than
(
0
)
end
end
context
'restricted signup domains'
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