BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
56bcb3e8
Unverified
Commit
56bcb3e8
authored
Feb 03, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::CurrentSettings instead of current_application_settings
parent
bf278f79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
project_auto_devops.rb
app/models/project_auto_devops.rb
+1
-3
admin_settings_spec.rb
spec/features/admin/admin_settings_spec.rb
+2
-2
project_auto_devops_spec.rb
spec/models/project_auto_devops_spec.rb
+4
-4
No files found.
app/models/project_auto_devops.rb
View file @
56bcb3e8
class
ProjectAutoDevops
<
ActiveRecord
::
Base
include
Gitlab
::
CurrentSettings
belongs_to
:project
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
...
...
@@ -9,7 +7,7 @@ class ProjectAutoDevops < ActiveRecord::Base
validates
:domain
,
allow_blank:
true
,
hostname:
{
allow_numeric_hostname:
true
}
def
instance_domain
current_application_s
ettings
.
auto_devops_domain
Gitlab
::
CurrentS
ettings
.
auto_devops_domain
end
def
has_domain?
...
...
spec/features/admin/admin_settings_spec.rb
View file @
56bcb3e8
...
...
@@ -52,8 +52,8 @@ feature 'Admin updates settings' do
fill_in
'Auto devops domain'
,
with:
'domain.com'
click_button
'Save'
expect
(
current_application_s
ettings
.
auto_devops_enabled?
).
to
be
true
expect
(
current_application_s
ettings
.
auto_devops_domain
).
to
eq
(
'domain.com'
)
expect
(
Gitlab
::
CurrentS
ettings
.
auto_devops_enabled?
).
to
be
true
expect
(
Gitlab
::
CurrentS
ettings
.
auto_devops_domain
).
to
eq
(
'domain.com'
)
expect
(
page
).
to
have_content
"Application settings saved successfully"
end
...
...
spec/models/project_auto_devops_spec.rb
View file @
56bcb3e8
...
...
@@ -20,7 +20,7 @@ describe ProjectAutoDevops do
context
'when there is an instance domain specified'
do
before
do
stub_application_setting
(
auto_devops_domain:
'example.com'
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:auto_devops_domain
).
and_return
(
'example.com'
)
end
it
{
expect
(
auto_devops
).
to
have_domain
}
...
...
@@ -28,7 +28,7 @@ describe ProjectAutoDevops do
context
'when there is no instance domain specified'
do
before
do
stub_application_setting
(
auto_devops_domain:
nil
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:auto_devops_domain
).
and_return
(
nil
)
end
it
{
expect
(
auto_devops
).
not_to
have_domain
}
...
...
@@ -52,7 +52,7 @@ describe ProjectAutoDevops do
context
'when there is an instance domain specified'
do
before
do
stub_application_setting
(
auto_devops_domain:
'example.com'
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:auto_devops_domain
).
and_return
(
'example.com'
)
end
it
{
expect
(
auto_devops
.
variables
).
to
include
(
domain_variable
)
}
...
...
@@ -60,7 +60,7 @@ describe ProjectAutoDevops do
context
'when there is no instance domain specified'
do
before
do
stub_application_setting
(
auto_devops_domain:
nil
)
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:auto_devops_domain
).
and_return
(
nil
)
end
it
{
expect
(
auto_devops
.
variables
).
not_to
include
(
domain_variable
)
}
...
...
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