diff options
Diffstat (limited to 'spec/factories/container_repositories.rb')
-rw-r--r-- | spec/factories/container_repositories.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/factories/container_repositories.rb b/spec/factories/container_repositories.rb index 86bb129067f..ce83e9e8006 100644 --- a/spec/factories/container_repositories.rb +++ b/spec/factories/container_repositories.rb @@ -33,6 +33,52 @@ FactoryBot.define do expiration_policy_cleanup_status { :cleanup_ongoing } end + trait :default do + migration_state { 'default' } + end + + trait :pre_importing do + migration_state { 'pre_importing' } + migration_pre_import_started_at { Time.zone.now } + end + + trait :pre_import_done do + migration_state { 'pre_import_done' } + migration_pre_import_started_at { Time.zone.now } + migration_pre_import_done_at { Time.zone.now } + end + + trait :importing do + migration_state { 'importing' } + migration_pre_import_started_at { Time.zone.now } + migration_pre_import_done_at { Time.zone.now } + migration_import_started_at { Time.zone.now } + end + + trait :import_done do + migration_state { 'import_done' } + migration_pre_import_started_at { Time.zone.now } + migration_pre_import_done_at { Time.zone.now } + migration_import_started_at { Time.zone.now } + migration_import_done_at { Time.zone.now } + end + + trait :import_aborted do + migration_state { 'import_aborted' } + migration_pre_import_started_at { Time.zone.now } + migration_pre_import_done_at { Time.zone.now } + migration_import_started_at { Time.zone.now } + migration_aborted_at { Time.zone.now } + migration_aborted_in_state { 'importing' } + migration_retries_count { 1 } + end + + trait :import_skipped do + migration_state { 'import_skipped' } + migration_skipped_at { Time.zone.now } + migration_skipped_reason { :too_many_tags } + end + after(:build) do |repository, evaluator| next if evaluator.tags.to_a.none? |