summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2017-10-23 23:05:59 +0200
committerAhmad Sherif <me@ahmadsherif.com>2017-10-26 13:04:33 +0200
commit76becfb5b4cf9030f4098e7eab435c8e42dd8a45 (patch)
treecbfccbede5c1ec8a69ac35b370fd8329a9a8366b /spec/lib
parent3ddffec0d62146e27298a982a7d2935dbe518fb9 (diff)
downloadgitlab-ce-76becfb5b4cf9030f4098e7eab435c8e42dd8a45.tar.gz
Add path attribute to WikiFile class
Fixes #39420
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/banzai/filter/gollum_tags_filter_spec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
index 97d612e6347..ca76d6f0881 100644
--- a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
+++ b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
@@ -15,9 +15,13 @@ describe Banzai::Filter::GollumTagsFilter do
context 'linking internal images' do
it 'creates img tag if image exists' do
- file = Gollum::File.new(project_wiki.wiki)
- expect(file).to receive(:path).and_return('images/image.jpg')
- expect(project_wiki).to receive(:find_file).with('images/image.jpg').and_return(file)
+ gollum_file_double = double('Gollum::File',
+ mime_type: 'image/jpeg',
+ name: 'images/image.jpg',
+ path: 'images/image.jpg',
+ raw_data: '')
+ wiki_file = Gitlab::Git::WikiFile.new(gollum_file_double)
+ expect(project_wiki).to receive(:find_file).with('images/image.jpg').and_return(wiki_file)
tag = '[[images/image.jpg]]'
doc = filter("See #{tag}", project_wiki: project_wiki)