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
27b4290f
Commit
27b4290f
authored
Dec 05, 2019
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default values for wildcard and domain_type
parent
86fa482a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
app/models/pages_domain.rb
app/models/pages_domain.rb
+2
-0
spec/models/pages_domain_spec.rb
spec/models/pages_domain_spec.rb
+10
-0
No files found.
app/models/pages_domain.rb
View file @
27b4290f
...
...
@@ -26,6 +26,8 @@ class PagesDomain < ApplicationRecord
validate
:validate_intermediates
,
if:
->
(
domain
)
{
domain
.
certificate
.
present?
&&
domain
.
certificate_changed?
}
default_value_for
(
:auto_ssl_enabled
,
allow_nil:
false
)
{
::
Gitlab
::
LetsEncrypt
.
enabled?
}
default_value_for
:domain_type
,
allow_nil:
false
,
value: :project
default_value_for
:wildcard
,
allow_nil:
false
,
value:
false
attr_encrypted
:key
,
mode: :per_attribute_iv_and_salt
,
...
...
spec/models/pages_domain_spec.rb
View file @
27b4290f
...
...
@@ -175,6 +175,16 @@ describe PagesDomain do
it
{
is_expected
.
to
validate_presence_of
(
:verification_code
)
}
end
describe
'default values'
do
it
'defaults wildcard to false'
do
expect
(
subject
.
wildcard
).
to
eq
(
false
)
end
it
'defaults domain_type to project'
do
expect
(
subject
.
domain_type
).
to
eq
(
'project'
)
end
end
describe
'#verification_code'
do
subject
{
pages_domain
.
verification_code
}
...
...
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