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

parent ca87bb65
......@@ -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
......
......@@ -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
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