Commit 00b43ef6 authored by Tiger Watson's avatar Tiger Watson Committed by Rémy Coutable

Provide extra detail on `table` in migration tests

parent ed2f764d
...@@ -75,8 +75,9 @@ require_migration!('populate_foo_column') ...@@ -75,8 +75,9 @@ require_migration!('populate_foo_column')
Use the `table` helper to create a temporary `ActiveRecord::Base`-derived model Use the `table` helper to create a temporary `ActiveRecord::Base`-derived model
for a table. [FactoryBot](best_practices.md#factories) for a table. [FactoryBot](best_practices.md#factories)
**should not** be used to create data for migration specs. For example, to **should not** be used to create data for migration specs because it relies on
create a record in the `projects` table: 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 ```ruby
project = table(:projects).create!(id: 1, name: 'gitlab1', path: 'gitlab1') project = table(:projects).create!(id: 1, name: 'gitlab1', path: 'gitlab1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment