diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-04 14:41:37 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-04 14:41:37 +0300 |
commit | 7350eb1fa83662d4aaa7541acb387b3742ba9788 (patch) | |
tree | 881a23cd8807f2247707c875bc1be1502ff04ace /spec/lib/gitlab/wiki_file_finder_spec.rb | |
parent | 0b4f9ff4068af6776b495d9332aeecf58e48786f (diff) |
Add ability to search wiki titles
Diffstat (limited to 'spec/lib/gitlab/wiki_file_finder_spec.rb')
-rw-r--r-- | spec/lib/gitlab/wiki_file_finder_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/wiki_file_finder_spec.rb b/spec/lib/gitlab/wiki_file_finder_spec.rb new file mode 100644 index 00000000000..025d1203dc5 --- /dev/null +++ b/spec/lib/gitlab/wiki_file_finder_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe Gitlab::WikiFileFinder do + describe '#find' do + let(:project) { create(:project, :public, :wiki_repo) } + let(:wiki) { build(:project_wiki, project: project) } + + before do + wiki.create_page('Files/Title', 'Content') + wiki.create_page('CHANGELOG', 'Files example') + end + + it_behaves_like 'file finder' do + subject { described_class.new(project, project.wiki.default_branch) } + + let(:expected_file_by_name) { 'Files/Title.md' } + let(:expected_file_by_content) { 'CHANGELOG.md' } + end + end +end |