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
Boxiang Sun
gitlab-ce
Commits
d81597e0
Commit
d81597e0
authored
Mar 12, 2019
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove factories from IssuesMovedToIdForeignKey spec
parent
b0668b34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
spec/migrations/issues_moved_to_id_foreign_key_spec.rb
spec/migrations/issues_moved_to_id_foreign_key_spec.rb
+7
-8
No files found.
spec/migrations/issues_moved_to_id_foreign_key_spec.rb
View file @
d81597e0
require
'spec_helper'
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20171106151218_issues_moved_to_id_foreign_key.rb'
)
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20171106151218_issues_moved_to_id_foreign_key.rb'
)
# The schema version has to be far enough in advance to have the
describe
IssuesMovedToIdForeignKey
,
:migration
do
# only_mirror_protected_branches column in the projects table to create a
let
(
:issues
)
{
table
(
:issues
)
}
# project via FactoryBot.
describe
IssuesMovedToIdForeignKey
,
:migration
,
schema:
20171114150259
do
let!
(
:issue_third
)
{
issues
.
create!
}
let!
(
:issue_first
)
{
create
(
:issue
,
moved_to_id:
issue_second
.
id
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:issue_second
)
{
issues
.
create!
(
moved_to_id:
issue_third
.
id
)
}
let!
(
:issue_second
)
{
create
(
:issue
,
moved_to_id:
issue_third
.
id
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:issue_first
)
{
issues
.
create!
(
moved_to_id:
issue_second
.
id
)
}
let!
(
:issue_third
)
{
create
(
:issue
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
subject
{
described_class
.
new
}
subject
{
described_class
.
new
}
it
'removes the orphaned moved_to_id'
do
it
'removes the orphaned moved_to_id'
do
subject
.
down
subject
.
down
issue_third
.
update
(
moved_to_id:
10000
0
)
issue_third
.
update
!
(
moved_to_id:
0
)
subject
.
up
subject
.
up
...
...
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