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
00b43ef6
Commit
00b43ef6
authored
Nov 26, 2020
by
Tiger Watson
Committed by
Rémy Coutable
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide extra detail on `table` in migration tests
parent
ed2f764d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
doc/development/testing_guide/testing_migrations_guide.md
doc/development/testing_guide/testing_migrations_guide.md
+3
-2
No files found.
doc/development/testing_guide/testing_migrations_guide.md
View file @
00b43ef6
...
...
@@ -75,8 +75,9 @@ require_migration!('populate_foo_column')
Use the
`table`
helper to create a temporary
`ActiveRecord::Base`
-derived model
for a table.
[
FactoryBot
](
best_practices.md#factories
)
**should not**
be used to create data for migration specs. For example, to
create a record in the
`projects`
table:
**should not**
be used to create data for migration specs because it relies on
application code which can change after the migration has run, and cause the test
to fail. For example, to create a record in the
`projects`
table:
```
ruby
project
=
table
(
:projects
).
create!
(
id:
1
,
name:
'gitlab1'
,
path:
'gitlab1'
)
...
...
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