diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 00:09:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 00:09:16 +0300 |
commit | 154b9bae142ba15fec753f44327654595094b879 (patch) | |
tree | 027f8ae024961778d5b00c77a72fe302f985d4f3 /doc/development | |
parent | 2c156e3c7bbade01c36eee18327f1ced6eebea79 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development')
-rw-r--r-- | doc/development/background_migrations.md | 5 | ||||
-rw-r--r-- | doc/development/testing_guide/testing_migrations_guide.md | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md index 9dbfde98766..c28008c94b8 100644 --- a/doc/development/background_migrations.md +++ b/doc/development/background_migrations.md @@ -301,12 +301,13 @@ It is required to write tests for: - The background migration itself. - A cleanup migration. -You can use the `:migration` RSpec tag when testing the migrations. +The `:migration` and `schema: :latest` RSpec tags are automatically set for +background migration specs. See the [Testing Rails migrations](testing_guide/testing_migrations_guide.md#testing-a-non-activerecordmigration-class) style guide. -When you do that, keep in mind that `before` and `after` RSpec hooks are going +Keep in mind that `before` and `after` RSpec hooks are going to migrate you database down and up, which can result in other background migrations being called. That means that using `spy` test doubles with `have_received` is encouraged, instead of using regular test doubles, because diff --git a/doc/development/testing_guide/testing_migrations_guide.md b/doc/development/testing_guide/testing_migrations_guide.md index 05773f07b0f..a03b940fe40 100644 --- a/doc/development/testing_guide/testing_migrations_guide.md +++ b/doc/development/testing_guide/testing_migrations_guide.md @@ -158,7 +158,9 @@ end To test a non-`ActiveRecord::Migration` test (a background migration), you will need to manually provide a required schema version. Please add a -schema tag to a context that you want to switch the database schema within. +`schema` tag to a context that you want to switch the database schema within. + +If not set, `schema` defaults to `:latest`. Example: |