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
b7d8098b
Commit
b7d8098b
authored
7 years ago
by
James Lopez
Committed by
Stan Hu
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add migration spec
parent
f677aa7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
spec/migrations/remove_project_labels_group_id_spec.rb
spec/migrations/remove_project_labels_group_id_spec.rb
+21
-0
No files found.
spec/migrations/remove_project_labels_group_id_spec.rb
0 → 100644
View file @
b7d8098b
# encoding: utf-8
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20180202111106_remove_project_labels_group_id.rb'
)
describe
RemoveProjectLabelsGroupId
,
:delete
do
let
(
:migration
)
{
described_class
.
new
}
let
(
:group
)
{
create
(
:group
)
}
let!
(
:project_label
)
{
create
(
:label
,
group_id:
group
.
id
)
}
let!
(
:group_label
)
{
create
(
:group_label
)
}
describe
'#up'
do
it
'updates the project labels group ID'
do
expect
{
migration
.
up
}.
to
change
{
project_label
.
reload
.
group_id
}.
from
(
1
).
to
(
nil
)
end
it
'keeps the group labels group ID'
do
expect
{
migration
.
up
}.
not_to
change
{
group_label
.
reload
.
group_id
}
end
end
end
This diff is collapsed.
Click to expand it.
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