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
1f2c9915
Commit
1f2c9915
authored
Oct 15, 2018
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it only run the associated migration
parent
ffdb3f26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
spec/migrations/migrate_issues_to_ghost_user_spec.rb
spec/migrations/migrate_issues_to_ghost_user_spec.rb
+6
-6
No files found.
spec/migrations/migrate_issues_to_ghost_user_spec.rb
View file @
1f2c9915
...
...
@@ -18,33 +18,33 @@ describe MigrateIssuesToGhostUser, :migration do
let!
(
:ghost
)
{
users
.
create
(
ghost:
true
,
email:
'ghost@example.com'
)
}
it
'does not create a new user'
do
expect
{
schema_migrate_up
!
}.
not_to
change
{
User
.
count
}
expect
{
migrate
!
}.
not_to
change
{
User
.
count
}
end
it
'migrates issues where author = nil to the ghost user'
do
schema_migrate_up
!
migrate
!
expect
(
issues
.
first
.
reload
.
author_id
).
to
eq
(
ghost
.
id
)
end
it
'does not change issues authored by an existing user'
do
expect
{
schema_migrate_up
!
}.
not_to
change
{
issues
.
second
.
reload
.
author_id
}
expect
{
migrate
!
}.
not_to
change
{
issues
.
second
.
reload
.
author_id
}
end
end
context
'when ghost user does not exist'
do
it
'creates a new user'
do
expect
{
schema_migrate_up
!
}.
to
change
{
User
.
count
}.
by
(
1
)
expect
{
migrate
!
}.
to
change
{
User
.
count
}.
by
(
1
)
end
it
'migrates issues where author = nil to the ghost user'
do
schema_migrate_up
!
migrate
!
expect
(
issues
.
first
.
reload
.
author_id
).
to
eq
(
User
.
ghost
.
id
)
end
it
'does not change issues authored by an existing user'
do
expect
{
schema_migrate_up
!
}.
not_to
change
{
issues
.
second
.
reload
.
author_id
}
expect
{
migrate
!
}.
not_to
change
{
issues
.
second
.
reload
.
author_id
}
end
end
end
...
...
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