f0391c2517
Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
15 lines
366 B
Ruby
15 lines
366 B
Ruby
# frozen_string_literal: true
|
|
|
|
module WikiHelpers
|
|
extend self
|
|
|
|
def upload_file_to_wiki(project, user, file_name)
|
|
opts = {
|
|
file_name: file_name,
|
|
file_content: File.read(expand_fixture_path(file_name))
|
|
}
|
|
|
|
::Wikis::CreateAttachmentService.new(project, user, opts)
|
|
.execute[:result][:file_path]
|
|
end
|
|
end
|