gitlab-org--gitlab-foss/spec/support/helpers/wiki_helpers.rb
2018-10-17 15:47:05 +00:00

13 lines
335 B
Ruby

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