Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Braha Stoll <alexbrahastoll@gmail.com>2016-12-16 07:12:21 +0300
committerAlex Braha Stoll <alexbrahastoll@gmail.com>2016-12-31 21:55:50 +0300
commit8bf52a4ae3aebc8c58f51cff696e99ecafe9c7c8 (patch)
tree498f99458cfdb5dc4ff83f2abec6eee5c4136e51 /spec/models/wiki_page_spec.rb
parent8dc2163ce580f1d71be1cf45e5dfcb2b4763d7bb (diff)
Show directory hierarchy when listing wiki pages
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r--spec/models/wiki_page_spec.rb17
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