Commit 322402aa authored by Stan Hu's avatar Stan Hu

Add more tests and comments around Wiki formatting

parent b103f614
......@@ -64,6 +64,7 @@ module Gitlab
end
end
# Convenience methods for initializing a new repository with a Project model.
def create_project_repository(project)
create_repository(project.repository_storage, project.disk_path, project.full_path)
end
......
require 'spec_helper'
describe Gitlab::BitbucketImport::WikiFormatter do
let(:project) do
create(:project,
namespace: create(:namespace, path: 'gitlabhq'),
import_url: 'https://xxx@bitbucket.org/gitlabhq/sample.gitlabhq.git')
end
subject(:wiki) { described_class.new(project) }
describe '#disk_path' do
it 'appends .wiki to disk path' do
expect(wiki.disk_path).to eq project.wiki.disk_path
end
end
describe '#full_path' do
it 'appends .wiki to project path' do
expect(wiki.full_path).to eq project.wiki.full_path
end
end
describe '#import_url' do
it 'returns URL of the wiki repository' do
expect(wiki.import_url).to eq 'https://xxx@bitbucket.org/gitlabhq/sample.gitlabhq.git/wiki'
end
end
end
......@@ -10,11 +10,17 @@ describe Gitlab::LegacyGithubImport::WikiFormatter do
subject(:wiki) { described_class.new(project) }
describe '#disk_path' do
it 'appends .wiki to project path' do
it 'appends .wiki to disk path' do
expect(wiki.disk_path).to eq project.wiki.disk_path
end
end
describe '#full_path' do
it 'appends .wiki to project path' do
expect(wiki.full_path).to eq project.wiki.full_path
end
end
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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment