diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-08-21 14:47:44 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-08-21 14:47:44 +0300 |
commit | e00e62c2c8ddf8d12145660a3478065caab4c4ca (patch) | |
tree | df5600704090efccaa399816556696e4487c4e36 /spec/support | |
parent | d6547ce0e78e2eecac76af8509cc5f7eea5fc369 (diff) | |
parent | 3a1103fd9173e8cb7a70c871d6a54a846f6eee4a (diff) |
Merge branch 'backstage/gb/migrate-stages-statuses' into 'master'
Migrate CI/CD stages statuses
Closes #33453
See merge request !12584
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/background_migrations_matchers.rb | 13 |
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 |