Commit 7bd68ae0 authored by Alex Braha Stoll's avatar Alex Braha Stoll

Add WikiDirectory#to_partial_path

parent 84735186
...@@ -10,4 +10,10 @@ class WikiDirectory ...@@ -10,4 +10,10 @@ class WikiDirectory
@pages = pages @pages = pages
@directories = directories @directories = directories
end end
# Relative path to the partial to be used when rendering collections
# of this object.
def to_partial_path
'projects/wikis/wiki_directory'
end
end end
...@@ -42,4 +42,12 @@ RSpec.describe WikiDirectory, models: true do ...@@ -42,4 +42,12 @@ RSpec.describe WikiDirectory, models: true do
end end
end end
end end
describe '#to_partial_path' do
it 'returns the relative path to the partial to be used' do
directory = build(:wiki_directory)
expect(directory.to_partial_path).to eq('projects/wikis/wiki_directory')
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment