summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-04-13 13:17:52 +0000
committerDouwe Maan <douwe@gitlab.com>2018-04-13 13:17:52 +0000
commitef48664047881411ea849e02c5a675c06275b868 (patch)
tree0047ab15dc175ff808d6c474e7d8ae0c000c2842 /spec
parent9ab4408bfa82602c54673a6fc1691d201a29c7cf (diff)
downloadgitlab-ce-ef48664047881411ea849e02c5a675c06275b868.tar.gz
Replacing gollum libs for custom gitlab ones
Diffstat (limited to 'spec')
-rw-r--r--spec/initializers/gollum_spec.rb62
1 files changed, 0 insertions, 62 deletions
diff --git a/spec/initializers/gollum_spec.rb b/spec/initializers/gollum_spec.rb
deleted file mode 100644
index adf824a8947..00000000000
--- a/spec/initializers/gollum_spec.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'spec_helper'
-
-describe 'gollum' do
- let(:project) { create(:project) }
- let(:user) { project.owner }
- let(:wiki) { ProjectWiki.new(project, user) }
- let(:gollum_wiki) { Gollum::Wiki.new(wiki.repository.path) }
-
- before do
- create_page(page_name, 'content1')
- end
-
- after do
- destroy_page(page_name)
- end
-
- context 'with simple paths' do
- let(:page_name) { 'page1' }
-
- it 'returns the entry hash if it matches the file name' do
- expect(tree_entry(page_name)).not_to be_nil
- end
-
- it 'returns nil if the path does not fit completely' do
- expect(tree_entry("foo/#{page_name}")).to be_nil
- end
- end
-
- context 'with complex paths' do
- let(:page_name) { '/foo/bar/page2' }
-
- it 'returns the entry hash if it matches the file name' do
- expect(tree_entry(page_name)).not_to be_nil
- end
-
- it 'returns nil if the path does not fit completely' do
- expect(tree_entry("foo1/bar/page2")).to be_nil
- expect(tree_entry("foo/bar1/page2")).to be_nil
- end
- end
-
- def tree_entry(name)
- gollum_wiki.repo.git.tree_entry(wiki_commits[0].commit, name + '.md')
- end
-
- def wiki_commits
- gollum_wiki.repo.commits
- end
-
- def commit_details
- Gitlab::Git::Wiki::CommitDetails.new(user.name, user.email, "test commit")
- end
-
- def create_page(name, content)
- wiki.wiki.write_page(name, :markdown, content, commit_details)
- end
-
- def destroy_page(name)
- page = wiki.find_page(name).page
- wiki.delete_page(page, "test commit")
- end
-end