diff options
Diffstat (limited to 'spec/factories/bulk_import')
-rw-r--r-- | spec/factories/bulk_import/entities.rb | 20 | ||||
-rw-r--r-- | spec/factories/bulk_import/trackers.rb | 10 |
2 files changed, 30 insertions, 0 deletions
diff --git a/spec/factories/bulk_import/entities.rb b/spec/factories/bulk_import/entities.rb index 3bf6af92d00..cf31ffec4f6 100644 --- a/spec/factories/bulk_import/entities.rb +++ b/spec/factories/bulk_import/entities.rb @@ -17,5 +17,25 @@ FactoryBot.define do trait(:project_entity) do source_type { :project_entity } end + + trait :created do + status { 0 } + end + + trait :started do + status { 1 } + + sequence(:jid) { |n| "bulk_import_entity_#{n}" } + end + + trait :finished do + status { 2 } + + sequence(:jid) { |n| "bulk_import_entity_#{n}" } + end + + trait :failed do + status { -1 } + end end end diff --git a/spec/factories/bulk_import/trackers.rb b/spec/factories/bulk_import/trackers.rb new file mode 100644 index 00000000000..7a1fa0849fc --- /dev/null +++ b/spec/factories/bulk_import/trackers.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :bulk_import_tracker, class: 'BulkImports::Tracker' do + association :entity, factory: :bulk_import_entity + + relation { :relation } + has_next_page { false } + end +end |