summaryrefslogtreecommitdiff
path: root/spec/factories.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-26 04:40:49 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-26 04:40:49 -0800
commite750efd9fc5b50fc8bed0bc73ba121c03c8b58a4 (patch)
tree657dbf3d32f883f09c25ba0c1b87cb0eb0b20382 /spec/factories.rb
parent2d5a6fc850844fb30c94c749fed5564f54052b77 (diff)
parent79a4ed15cefc4f70919a8a0b5059816f823d69d2 (diff)
downloadgitlab-ce-e750efd9fc5b50fc8bed0bc73ba121c03c8b58a4.tar.gz
Merge pull request #2067 from riyad/diff-and-patch-for-commits-and-merge-requests
Diff and patch for commits and merge requests
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 c673606b984..a26a77dd860 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -70,7 +70,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