Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter

This commit is contained in:
Douglas Barbosa Alexandre 2016-01-12 14:50:25 -02:00
parent ca87bb652a
commit 89e8b82b63
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ module Gitlab
end
def import_url
project.import_url.sub(".git", ".wiki.git")
project.import_url.sub(/\.git\z/, ".wiki.git")
end
end
end

View file

@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::GithubImport::WikiFormatter, lib: true do
let(:project) do
create(:project, namespace: create(:namespace, path: 'gitlabhq'),
import_url: 'https://xxx@github.com/gitlabhq/gitlabhq.git')
import_url: 'https://xxx@github.com/gitlabhq/sample.gitlabhq.git')
end
subject(:wiki) { described_class.new(project)}
@ -16,7 +16,7 @@ describe Gitlab::GithubImport::WikiFormatter, lib: true do
describe '#import_url' do
it 'returns URL of the wiki repository' do
expect(wiki.import_url).to eq 'https://xxx@github.com/gitlabhq/gitlabhq.wiki.git'
expect(wiki.import_url).to eq 'https://xxx@github.com/gitlabhq/sample.gitlabhq.wiki.git'
end
end
end