summaryrefslogtreecommitdiff
path: root/spec/factories.rb
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-11-25 00:04:13 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-11-25 00:06:53 +0100
commit267b18dead74106420430f79cde38fd90c17445d (patch)
treef9ac44bfdf694e38a142f49cbfa3d8daff6c8b71 /spec/factories.rb
parentb3834bc9b03566252ca83f70f4af882561ac261f (diff)
downloadgitlab-ce-267b18dead74106420430f79cde38fd90c17445d.tar.gz
Add specs for exporting merge requests as diff or patch
Diffstat (limited to 'spec/factories.rb')
-rw-r--r--spec/factories.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/factories.rb b/spec/factories.rb
index 7c33f0ecc8b..e0b472afea5 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -63,7 +63,22 @@ FactoryGirl.define do
closed true
end
+ # pick 3 commits "at random" (from bcf03b5d~3 to bcf03b5d)
+ trait :with_diffs do
+ target_branch "bcf03b5d~3"
+ source_branch "bcf03b5d"
+ st_commits do
+ [Commit.new(project.repo.commit('bcf03b5d')),
+ Commit.new(project.repo.commit('bcf03b5d~1')),
+ Commit.new(project.repo.commit('bcf03b5d~2'))]
+ end
+ st_diffs do
+ project.repo.diff("bcf03b5d~3", "bcf03b5d")
+ end
+ end
+
factory :closed_merge_request, traits: [:closed]
+ factory :merge_request_with_diffs, traits: [:with_diffs]
end
factory :note do