diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-31 19:07:24 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-31 19:07:24 +0400 |
commit | 5a68c20fba095ec61aa3b74cb0fbeb69adbc1373 (patch) | |
tree | be6f065a311e340068cd04307bb94b131038d749 /spec/factories | |
parent | c2c7d14ec51ec8654cc4e0ca57ba0bc146fd8725 (diff) |
Fix MR factory and some MR tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/merge_requests.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb new file mode 100644 index 00000000000..80dbd2f429b --- /dev/null +++ b/spec/factories/merge_requests.rb @@ -0,0 +1,39 @@ +FactoryGirl.define do + factory :merge_request do + title + author + source_project factory: :project + target_project { source_project } + + # → git log --pretty=oneline feature..master + # 5937ac0a7beb003549fc5fd26fc247adbce4a52e Add submodule from gitlab.com + # 570e7b2abdd848b95f2f578043fc23bd6f6fd24d Change some files + # 6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 More submodules + # d14d6c0abdd253381df51a723d58691b2ee1ab08 Remove ds_store files + # c1acaa58bbcbc3eafe538cb8274ba387047b69f8 Ignore DS files + source_branch "master" + target_branch "feature" + + merge_status :can_be_merged + + trait :with_diffs do + end + + trait :closed do + state :closed + end + + trait :reopened do + state :reopened + end + + trait :simple do + source_branch "feature" + target_branch "master" + end + + factory :closed_merge_request, traits: [:closed] + factory :reopened_merge_request, traits: [:reopened] + factory :merge_request_with_diffs, traits: [:with_diffs] + end +end |