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
Léo-Paul Géneau
gitlab-ce
Commits
1c404c91
Commit
1c404c91
authored
Jan 06, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new test for emptified params
parent
2d3c7d29
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
spec/migrations/migrate_kubernetes_service_to_new_clusters_architectures_spec.rb
..._kubernetes_service_to_new_clusters_architectures_spec.rb
+19
-2
No files found.
spec/migrations/migrate_kubernetes_service_to_new_clusters_architectures_spec.rb
View file @
1c404c91
...
...
@@ -42,8 +42,8 @@ describe MigrateKubernetesServiceToNewClustersArchitectures, :migration do
context
'when KubernetesService is not active'
do
let
(
:active
)
{
false
}
# Platforms::Kubernetes validates `token` reagdless of the activeness
# KubernetesService validates `token` if only it's activated
# Platforms::Kubernetes validates `token` reagdless of the activeness
,
#
whereas
KubernetesService validates `token` if only it's activated
# However, in this migration file, there are no validations because of the migration specific model class
# therefore, Validation Error will not happen in this case and just migrate data
let
(
:token
)
{
''
}
...
...
@@ -169,6 +169,23 @@ describe MigrateKubernetesServiceToNewClustersArchitectures, :migration do
end
end
context
'when KubernetesService has nullified parameters'
do
let
(
:project
)
{
create
(
:project
)
}
before
do
ActiveRecord
::
Base
.
connection
.
execute
<<~
SQL
INSERT INTO services (project_id, active, category, type, properties)
VALUES (
#{
project
.
id
}
, false, 'deployment', 'KubernetesService', '{}');
SQL
end
it
'does not migrate the KubernetesService and disables the kubernetes_service'
do
expect
{
migrate!
}.
not_to
change
{
Clusters
::
Cluster
.
count
}
expect
(
project
.
kubernetes_service
).
not_to
be_active
end
end
context
'when KubernetesService does not exist'
do
let!
(
:project
)
{
create
(
:project
)
}
...
...
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