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
Jérome Perrin
gitlab-ce
Commits
3443f3eb
Commit
3443f3eb
authored
Feb 02, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename AutoDevopsHelper helper methods
parent
c120b7a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
app/helpers/auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+5
-5
spec/helpers/auto_devops_helper_spec.rb
spec/helpers/auto_devops_helper_spec.rb
+5
-5
No files found.
app/helpers/auto_devops_helper.rb
View file @
3443f3eb
...
...
@@ -9,28 +9,28 @@ module AutoDevopsHelper
end
def
auto_devops_warning_message
(
project
)
if
missing_service?
(
project
)
if
missing_
auto_devops_
service?
(
project
)
params
=
{
kubernetes:
link_to
(
'Kubernetes cluster'
,
project_clusters_path
(
project
))
}
if
missing_domain?
(
project
)
if
missing_
auto_devops_
domain?
(
project
)
_
(
'Auto Review Apps and Auto Deploy need a domain name and a %{kubernetes} to work correctly.'
)
%
params
else
_
(
'Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly.'
)
%
params
end
elsif
missing_domain?
(
project
)
elsif
missing_
auto_devops_
domain?
(
project
)
_
(
'Auto Review Apps and Auto Deploy need a domain name to work correctly.'
)
end
end
private
def
missing_domain?
(
project
)
def
missing_
auto_devops_
domain?
(
project
)
!
(
project
.
auto_devops
&
.
has_domain?
||
current_application_settings
.
auto_devops_domain
.
present?
)
end
def
missing_service?
(
project
)
def
missing_
auto_devops_
service?
(
project
)
!
project
.
deployment_platform
&
.
active?
end
end
spec/helpers/auto_devops_helper_spec.rb
View file @
3443f3eb
...
...
@@ -88,12 +88,12 @@ describe AutoDevopsHelper do
context
'when the service is missing'
do
before
do
allow
(
helper
).
to
receive
(
:missing_service?
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:missing_
auto_devops_
service?
).
and_return
(
true
)
end
context
'when the domain is missing'
do
before
do
allow
(
helper
).
to
receive
(
:missing_domain?
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:missing_
auto_devops_
domain?
).
and_return
(
true
)
end
it
{
is_expected
.
to
match
(
/Auto Review Apps and Auto Deploy need a domain name and a .* to work correctly./
)
}
...
...
@@ -101,7 +101,7 @@ describe AutoDevopsHelper do
context
'when the domain is not missing'
do
before
do
allow
(
helper
).
to
receive
(
:missing_domain?
).
and_return
(
false
)
allow
(
helper
).
to
receive
(
:missing_
auto_devops_
domain?
).
and_return
(
false
)
end
it
{
is_expected
.
to
match
(
/Auto Review Apps and Auto Deploy need a .* to work correctly./
)
}
...
...
@@ -110,8 +110,8 @@ describe AutoDevopsHelper do
context
'when the domain is missing'
do
before
do
allow
(
helper
).
to
receive
(
:missing_service?
).
and_return
(
false
)
allow
(
helper
).
to
receive
(
:missing_domain?
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:missing_
auto_devops_
service?
).
and_return
(
false
)
allow
(
helper
).
to
receive
(
:missing_
auto_devops_
domain?
).
and_return
(
true
)
end
it
{
is_expected
.
to
eq
(
'Auto Review Apps and Auto Deploy need a domain name to work correctly.'
)
}
...
...
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