Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/background_migrations_matchers.rb')
-rw-r--r--spec/support/matchers/background_migrations_matchers.rb7
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