2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-01-19 16:12:03 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
describe Gitlab::LegacyGithubImport::WikiFormatter do
|
2016-01-19 16:12:03 +05:30
|
|
|
let(:project) do
|
2016-06-02 11:05:42 +05:30
|
|
|
create(:project,
|
|
|
|
namespace: create(:namespace, path: 'gitlabhq'),
|
|
|
|
import_url: 'https://xxx@github.com/gitlabhq/sample.gitlabhq.git')
|
2016-01-19 16:12:03 +05:30
|
|
|
end
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
subject(:wiki) { described_class.new(project) }
|
2016-01-19 16:12:03 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe '#disk_path' do
|
2019-03-02 22:35:43 +05:30
|
|
|
it 'appends .wiki to disk path' do
|
2018-03-17 18:26:18 +05:30
|
|
|
expect(wiki.disk_path).to eq project.wiki.disk_path
|
2016-01-19 16:12:03 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
describe '#full_path' do
|
|
|
|
it 'appends .wiki to project path' do
|
|
|
|
expect(wiki.full_path).to eq project.wiki.full_path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-01-19 16:12:03 +05:30
|
|
|
describe '#import_url' do
|
|
|
|
it 'returns URL of the wiki repository' do
|
|
|
|
expect(wiki.import_url).to eq 'https://xxx@github.com/gitlabhq/sample.gitlabhq.wiki.git'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|