diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-28 15:09:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-28 15:09:11 +0300 |
commit | eea806d673f060c2660c84ef8fe7f964824460de (patch) | |
tree | 35c76559074ef7d1b0135f9531ed77253b5cb1b5 /spec/support/matchers | |
parent | d81f7fc0b3c75a7c95528f21d55be2dd26521f2e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/matchers')
-rw-r--r-- | spec/support/matchers/background_migrations_matchers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/matchers/background_migrations_matchers.rb b/spec/support/matchers/background_migrations_matchers.rb index c5b3e140585..9f39f576b95 100644 --- a/spec/support/matchers/background_migrations_matchers.rb +++ b/spec/support/matchers/background_migrations_matchers.rb @@ -74,6 +74,13 @@ RSpec::Matchers.define :have_scheduled_batched_migration do |gitlab_schema: :git .for_configuration(gitlab_schema, migration, table_name, column_name, job_arguments) expect(batched_migrations.count).to be(1) + + # the :batch_min_value & :batch_max_value attribute argument values get applied to the + # :min_value & :max_value columns on the database. Here we change the attribute names + # for the rspec have_attributes matcher used below to pass + attributes[:min_value] = attributes.delete :batch_min_value if attributes.include?(:batch_min_value) + attributes[:max_value] = attributes.delete :batch_max_value if attributes.include?(:batch_max_value) + expect(batched_migrations).to all(have_attributes(attributes)) if attributes.present? end |