summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-05-07 19:25:51 +0200
committerDouwe Maan <douwe@selenight.nl>2018-05-07 19:25:51 +0200
commitbb3b7acb068bba6b841c453b7edac441c86c2650 (patch)
treebf14ab5063a04554eef2a317e849051f46f338c7 /spec
parent2c601eb7871a5cd3daa8e91653ad752137ac2b2d (diff)
downloadgitlab-ce-bb3b7acb068bba6b841c453b7edac441c86c2650.tar.gz
Don't always create a new import_state record from project factory
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/projects.rb32
1 files changed, 4 insertions, 28 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 9ab57af1c60..522e759d8d6 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -69,43 +69,19 @@ FactoryBot.define do
end
trait :import_scheduled do
- transient do
- status :scheduled
- end
-
- before(:create) do |project, evaluator|
- project.create_import_state(status: evaluator.status)
- end
+ import_status :scheduled
end
trait :import_started do
- transient do
- status :started
- end
-
- before(:create) do |project, evaluator|
- project.create_import_state(status: evaluator.status)
- end
+ import_status :started
end
trait :import_finished do
- transient do
- status :finished
- end
-
- before(:create) do |project, evaluator|
- project.create_import_state(status: evaluator.status)
- end
+ import_status :finished
end
trait :import_failed do
- transient do
- status :failed
- end
-
- before(:create) do |project, evaluator|
- project.create_import_state(status: evaluator.status)
- end
+ import_status :failed
end
trait :archived do