summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-05 10:54:48 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-05 10:54:48 +0200
commit6c477d5b9496829eb5cb56ef32a0dd813be7dc16 (patch)
treeb744bfdbeed906271aac62917abf9d44f58d56c3 /spec/support
parentc5ede858eab81e662c48761749ff2fa22dbfa9df (diff)
downloadgitlab-ce-6c477d5b9496829eb5cb56ef32a0dd813be7dc16.tar.gz
Move stages status migration to the background workerbackstage/gb/migrate-stages-statuses
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/background_migrations_matchers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/background_migrations_matchers.rb b/spec/support/background_migrations_matchers.rb
new file mode 100644
index 00000000000..423c0e4cefc
--- /dev/null
+++ b/spec/support/background_migrations_matchers.rb
@@ -0,0 +1,13 @@
+RSpec::Matchers.define :be_scheduled_migration do |delay, *expected|
+ match do |migration|
+ BackgroundMigrationWorker.jobs.any? do |job|
+ job['args'] == [migration, expected] &&
+ job['at'].to_i == (delay.to_i + Time.now.to_i)
+ end
+ end
+
+ failure_message do |migration|
+ "Migration `#{migration}` with args `#{expected.inspect}` " \
+ 'not scheduled in expected time!'
+ end
+end