2019-08-22 10:57:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-04 11:41:37 +00:00
|
|
|
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) }
|
|
|
|
|
2019-10-24 00:07:18 +00:00
|
|
|
let(:expected_file_by_path) { 'Files/Title.md' }
|
2018-06-04 11:41:37 +00:00
|
|
|
let(:expected_file_by_content) { 'CHANGELOG.md' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|