diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-10-17 15:47:05 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-10-17 15:47:05 +0000 |
commit | b8cf360e2ae446db1f21c0275e2047d776730a05 (patch) | |
tree | 08aad72c9813659459247c74fc46b6db4bc2cd91 /spec/support | |
parent | 11152ddf3d4f977232676fea38eca28b7b6e6ddd (diff) | |
download | gitlab-ce-b8cf360e2ae446db1f21c0275e2047d776730a05.tar.gz |
Fixed bug with the content disposition with wiki attachments
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/wiki_helpers.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/helpers/wiki_helpers.rb b/spec/support/helpers/wiki_helpers.rb new file mode 100644 index 00000000000..8165403cb60 --- /dev/null +++ b/spec/support/helpers/wiki_helpers.rb @@ -0,0 +1,13 @@ +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 |