summaryrefslogtreecommitdiff
path: root/spec/factories/compares.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/compares.rb')
-rw-r--r--spec/factories/compares.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/factories/compares.rb b/spec/factories/compares.rb
new file mode 100644
index 00000000000..4dd94b93049
--- /dev/null
+++ b/spec/factories/compares.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :compare do
+ skip_create # No persistence
+
+ start_project { association(:project, :repository) }
+ target_project { start_project }
+
+ start_ref { 'master' }
+ target_ref { 'feature' }
+
+ base_sha { nil }
+ straight { false }
+
+ initialize_with do
+ CompareService
+ .new(start_project, start_ref)
+ .execute(target_project, target_ref, base_sha: base_sha, straight: straight)
+ end
+ end
+end