summaryrefslogtreecommitdiff
path: root/spec/support/helpers/wiki_helpers.rb
blob: 06cea728b42c0309524d6c196720242746c728e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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