diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-09 19:17:40 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-18 17:12:16 +0300 |
commit | 4a9efc606f5cdd9cf3aa34991543eb2f77555914 (patch) | |
tree | 29bfd4a795c5a2f77f6b8d46804f2fc7e8a83bc6 /spec/factories/merge_requests.rb | |
parent | c09de611ea9d8cbff7a1696ee63262ef65972daa (diff) |
Move ci_environments_status to a model
GET :namespace/merge_requests/:id/ci_environments_status complexity
already reached a limit for a direct serialization from an hash
computed at within the controller function.
Here we introduce a virtual model EnvironmentStatus and its serializer.
Diffstat (limited to 'spec/factories/merge_requests.rb')
-rw-r--r-- | spec/factories/merge_requests.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index 8094c43b065..2392bfc4a53 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -101,6 +101,20 @@ FactoryBot.define do end end + trait :deployed_review_app do + target_branch 'pages-deploy-target' + + transient do + deployment { create(:deployment, :review_app) } + end + + after(:build) do |merge_request, evaluator| + merge_request.source_branch = evaluator.deployment.ref + merge_request.source_project = evaluator.deployment.project + merge_request.target_project = evaluator.deployment.project + end + end + after(:build) do |merge_request| target_project = merge_request.target_project source_project = merge_request.source_project |