diff options
author | Sean McGivern <sean@gitlab.com> | 2018-08-16 13:07:43 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-08-21 14:40:44 +0300 |
commit | c73da6c1e73f04ece18b5fca5ccd67bf918682f8 (patch) | |
tree | 40343fc8215ec0496d1aec604c394bbaac511510 /spec/support | |
parent | 6ac7162395a2651b992cf8c25436e20fde92252d (diff) |
Move Issue#{referenced,closed_by}_merge_requests to service
These methods don't really need to be on the Issue model. Issue#related_branches
can also be moved to a service, but we can do that in a separate commit.
This commit does not change any behaviour; it just moves code around, renames
the service, and refactors the specs.
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/cycle_analytics_helpers.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index c228bd2393b..e0fceae88de 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -65,7 +65,9 @@ module CycleAnalyticsHelpers end def merge_merge_requests_closing_issue(user, project, issue) - merge_requests = issue.closed_by_merge_requests(user) + merge_requests = Issues::ReferencedMergeRequestsService + .new(project, user) + .closed_by_merge_requests(issue) merge_requests.each { |merge_request| MergeRequests::MergeService.new(project, user).execute(merge_request) } end |