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
fb281d22
Commit
fb281d22
authored
Dec 18, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix corrputed tests
parent
4c2a33ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
16 deletions
+11
-16
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+3
-3
spec/ee/spec/models/ee/project_spec.rb
spec/ee/spec/models/ee/project_spec.rb
+3
-8
spec/finders/clusters_finder_spec.rb
spec/finders/clusters_finder_spec.rb
+1
-1
spec/models/clusters/cluster_spec.rb
spec/models/clusters/cluster_spec.rb
+3
-3
spec/services/clusters/create_service_spec.rb
spec/services/clusters/create_service_spec.rb
+1
-1
No files found.
spec/controllers/projects/clusters_controller_spec.rb
View file @
fb281d22
...
...
@@ -4,7 +4,7 @@ describe Projects::ClustersController do
include
AccessMatchersForController
include
GoogleApi
::
CloudPlatformHelpers
s
et
(
:project
)
{
create
(
:project
)
}
l
et
(
:project
)
{
create
(
:project
)
}
describe
'GET index'
do
describe
'functionality'
do
...
...
@@ -287,7 +287,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
s
et
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
l
et
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:params
)
do
{
cluster:
{
enabled:
false
}
}
...
...
@@ -371,7 +371,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/ee/spec/models/ee/project_spec.rb
View file @
fb281d22
...
...
@@ -709,7 +709,7 @@ describe Project do
context
'when environment is specified'
do
let
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'review/name'
)
}
let!
(
:default_cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
],
environment_scope:
'*'
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
environment_scope:
'review/*'
,
projects:
[
project
])
}
subject
{
project
.
deployment_platform
(
environment:
environment
)
}
...
...
@@ -782,8 +782,6 @@ describe Project do
end
context
'when environment scope has _'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
...
...
@@ -807,8 +805,6 @@ describe Project do
# it doesn't break in case some data sneaked in somehow as we're
# not checking this integrity in database level.
context
'when environment scope has %'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
...
...
@@ -827,15 +823,14 @@ describe Project do
end
end
context
'when variables with the same name have different environment scopes'
do
let!
(
:partially_matched_cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
],
environment_scope:
'review/*'
)
}
context
'when perfectly matched cluster exists'
do
let!
(
:perfectly_matched_cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
],
environment_scope:
'review/name'
)
}
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
it
'
puts variables matching environment scope more in the end
'
do
it
'
returns perfectly matched cluster as highest precedence
'
do
is_expected
.
to
eq
(
perfectly_matched_cluster
.
platform_kubernetes
)
end
end
...
...
spec/finders/clusters_finder_spec.rb
View file @
fb281d22
...
...
@@ -6,7 +6,7 @@ describe ClustersFinder do
describe
'#execute'
do
let
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
subject
{
described_class
.
new
(
project
,
user
,
scope
).
execute
}
...
...
spec/models/clusters/cluster_spec.rb
View file @
fb281d22
...
...
@@ -137,20 +137,20 @@ describe Clusters::Cluster do
end
context
'when identical environment scope exists in project'
do
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
],
environment_scope:
'product/*'
)
}
let
(
:cluster
)
{
build
(
:cluster
,
projects:
[
project
],
environment_scope:
'product/*'
)
}
it
{
is_expected
.
to
be_falsey
}
end
context
'when identical environment scope does not exist in project'
do
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
],
environment_scope:
'*'
)
}
let
(
:cluster
)
{
build
(
:cluster
,
projects:
[
project
],
environment_scope:
'*'
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'when identical environment scope exists in different project'
do
let
(
:project2
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project2
],
environment_scope:
'product/*'
)
}
let
(
:cluster
)
{
build
(
:cluster
,
projects:
[
project2
],
environment_scope:
'product/*'
)
}
it
{
is_expected
.
to
be_truthy
}
end
...
...
spec/services/clusters/create_service_spec.rb
View file @
fb281d22
...
...
@@ -81,7 +81,7 @@ describe Clusters::CreateService do
end
context
'when project has a cluster'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
and_call_original
...
...
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