debian-mirror-gitlab/spec/support/helpers/features/merge_request_helpers.rb
2021-02-22 17:27:13 +05:30

25 lines
737 B
Ruby

# frozen_string_literal: true
module Spec
module Support
module Helpers
module Features
module MergeRequestHelpers
def preload_view_requirements(merge_request, note)
# This will load the status fields of the author of the note and merge request
# to avoid queries when rendering the view being tested.
#
merge_request.author.status
note.author.status
end
def serialize_issuable_sidebar(user, project, merge_request)
MergeRequestSerializer
.new(current_user: user, project: project)
.represent(merge_request, serializer: 'sidebar')
end
end
end
end
end
end