2019-08-22 10:57:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-01-06 23:15:37 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 18:09:03 +00:00
|
|
|
RSpec.describe Gitlab::LegacyGithubImport::WikiFormatter do
|
2016-01-06 23:15:37 +00:00
|
|
|
let(:project) do
|
2017-08-02 19:55:11 +00:00
|
|
|
create(:project,
|
2016-03-21 16:29:19 +00:00
|
|
|
namespace: create(:namespace, path: 'gitlabhq'),
|
2016-03-21 14:11:05 +00:00
|
|
|
import_url: 'https://xxx@github.com/gitlabhq/sample.gitlabhq.git')
|
2016-03-04 17:37:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
subject(:wiki) { described_class.new(project) }
|
2016-01-06 23:15:37 +00:00
|
|
|
|
2017-07-22 00:37:22 +00:00
|
|
|
describe '#disk_path' do
|
2019-01-18 20:54:26 +00:00
|
|
|
it 'appends .wiki to disk path' do
|
2017-10-18 11:53:06 +00:00
|
|
|
expect(wiki.disk_path).to eq project.wiki.disk_path
|
2016-01-06 23:15:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-01-18 20:54:26 +00:00
|
|
|
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-06 23:15:37 +00:00
|
|
|
describe '#import_url' do
|
|
|
|
it 'returns URL of the wiki repository' do
|
2016-01-12 16:50:25 +00:00
|
|
|
expect(wiki.import_url).to eq 'https://xxx@github.com/gitlabhq/sample.gitlabhq.wiki.git'
|
2016-01-06 23:15:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|