diff options
author | Alex Braha Stoll <alexbrahastoll@gmail.com> | 2016-12-16 02:12:21 -0200 |
---|---|---|
committer | Alex Braha Stoll <alexbrahastoll@gmail.com> | 2016-12-31 16:55:50 -0200 |
commit | 8bf52a4ae3aebc8c58f51cff696e99ecafe9c7c8 (patch) | |
tree | 498f99458cfdb5dc4ff83f2abec6eee5c4136e51 /spec/models/wiki_page_spec.rb | |
parent | 8dc2163ce580f1d71be1cf45e5dfcb2b4763d7bb (diff) | |
download | gitlab-ce-8bf52a4ae3aebc8c58f51cff696e99ecafe9c7c8.tar.gz |
Show directory hierarchy when listing wiki pages
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r-- | spec/models/wiki_page_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index 5c34b1b0a30..25e7b517fe6 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -7,6 +7,23 @@ describe WikiPage, models: true do subject { WikiPage.new(wiki) } + describe '::group_by_directory' do + context 'when there are no pages' do + it 'returns an empty hash' do + end + end + + context 'when there are pages' do + let!(:page_1) { create_page('page_1', 'content') } + let!(:page_2) { create_page('directory/page_2', 'content') } + let(:pages) { [page_1, page_2] } + + xit 'returns a hash in which keys are directories and values are their pages' do + expected_grouped_pages = { 'root' => [page_1], 'directory' => [page_2] } + end + end + end + describe "#initialize" do context "when initialized with an existing gollum page" do before do |