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
c79c1d22
Commit
c79c1d22
authored
May 09, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE specific cluster spec parts to ee directory
parent
3311bfdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
28 deletions
+36
-28
ee/spec/models/ee/clusters/cluster_spec.rb
ee/spec/models/ee/clusters/cluster_spec.rb
+36
-0
spec/models/clusters/cluster_spec.rb
spec/models/clusters/cluster_spec.rb
+0
-28
No files found.
ee/spec/models/ee/clusters/cluster_spec.rb
0 → 100644
View file @
c79c1d22
require
'spec_helper'
describe
Clusters
::
Cluster
do
it
{
is_expected
.
to
include_module
(
HasEnvironmentScope
)
}
describe
'validation'
do
subject
{
cluster
.
valid?
}
context
'when validates unique_environment_scope'
do
let
(
:project
)
{
create
(
:project
)
}
before
do
create
(
:cluster
,
projects:
[
project
],
environment_scope:
'product/*'
)
end
context
'when identical environment scope exists in project'
do
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
)
{
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
)
{
build
(
:cluster
,
projects:
[
project2
],
environment_scope:
'product/*'
)
}
it
{
is_expected
.
to
be_truthy
}
end
end
end
end
spec/models/clusters/cluster_spec.rb
View file @
c79c1d22
...
...
@@ -14,7 +14,6 @@ describe Clusters::Cluster do
it
{
is_expected
.
to
delegate_method
(
:status_name
).
to
(
:provider
)
}
it
{
is_expected
.
to
delegate_method
(
:on_creation?
).
to
(
:provider
)
}
it
{
is_expected
.
to
respond_to
:project
}
it
{
is_expected
.
to
include_module
(
HasEnvironmentScope
)
}
describe
'.enabled'
do
subject
{
described_class
.
enabled
}
...
...
@@ -168,33 +167,6 @@ describe Clusters::Cluster do
it
{
expect
(
cluster
.
update
(
enabled:
false
)).
to
be_truthy
}
end
end
context
'when validates unique_environment_scope'
do
let
(
:project
)
{
create
(
:project
)
}
before
do
create
(
:cluster
,
projects:
[
project
],
environment_scope:
'product/*'
)
end
context
'when identical environment scope exists in project'
do
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
)
{
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
)
{
build
(
:cluster
,
projects:
[
project2
],
environment_scope:
'product/*'
)
}
it
{
is_expected
.
to
be_truthy
}
end
end
end
describe
'#provider'
do
...
...
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