2019-08-22 06:57:44 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-04 07:41:37 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe Gitlab::WikiFileFinder do
|
2018-06-04 07:41:37 -04:00
|
|
|
describe '#find' do
|
2021-06-30 05:08:07 -04:00
|
|
|
let_it_be(:project) do
|
|
|
|
create(:project, :public, :wiki_repo).tap do |project|
|
|
|
|
project.wiki.create_page('Files/Title', 'Content')
|
|
|
|
project.wiki.create_page('CHANGELOG', 'Files example')
|
|
|
|
end
|
2018-06-04 07:41:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'file finder' do
|
|
|
|
subject { described_class.new(project, project.wiki.default_branch) }
|
|
|
|
|
2019-10-23 20:07:18 -04:00
|
|
|
let(:expected_file_by_path) { 'Files/Title.md' }
|
2018-06-04 07:41:37 -04:00
|
|
|
let(:expected_file_by_content) { 'CHANGELOG.md' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|