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
b7f7c49f
Commit
b7f7c49f
authored
Apr 06, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix environment deployment platform filter method / EE
parent
9e2184bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
app/models/concerns/deployment_platform.rb
app/models/concerns/deployment_platform.rb
+1
-0
app/models/environment.rb
app/models/environment.rb
+1
-1
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+23
-0
No files found.
app/models/concerns/deployment_platform.rb
View file @
b7f7c49f
...
...
@@ -4,6 +4,7 @@ module DeploymentPlatform
def
deployment_platform
(
environment:
nil
)
@deployment_platform
||=
{}
return
find_deployment_platform
(
environment
)
@deployment_platform
[
environment
]
||=
find_deployment_platform
(
environment
)
end
...
...
app/models/environment.rb
View file @
b7f7c49f
...
...
@@ -228,7 +228,7 @@ class Environment < ActiveRecord::Base
end
def
deployment_platform
project
.
deployment_platform
(
environment:
self
)
project
.
deployment_platform
(
environment:
self
.
name
)
end
private
...
...
spec/models/environment_spec.rb
View file @
b7f7c49f
...
...
@@ -368,6 +368,29 @@ describe Environment do
end
end
describe
'#deployment_platform'
do
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
context
'when there is a deployment platform for environment'
do
let!
(
:cluster
)
do
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
end
it
'finds a deployment platform'
do
expect
(
environment
.
deployment_platform
).
to
eq
cluster
.
platform
end
end
context
'when there is no deployment platform for environment'
do
it
'returns nil'
do
expect
(
environment
.
deployment_platform
).
to
be_nil
end
end
end
describe
'#terminals'
do
subject
{
environment
.
terminals
}
...
...
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