Add WikiDirectory#to_partial_path
This commit is contained in:
parent
84735186a8
commit
7bd68ae079
2 changed files with 14 additions and 0 deletions
|
@ -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
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue