Commit 7ee9c3c4 authored by Stan Hu's avatar Stan Hu

Use project key instead of project name for imports

parent e52f6bf5
......@@ -50,7 +50,7 @@
= project.human_import_status_name
- @repos.each do |repo|
%tr{ id: "repo_#{repo.owner}___#{repo.slug}", data: { project: repo.project_name, repository: repo.slug } }
%tr{ id: "repo_#{repo.owner}___#{repo.slug}", data: { project: repo.project_key, repository: repo.slug } }
%td
= link_to repo.browse_url, repo.browse_url, target: '_blank', rel: 'noopener noreferrer'
%td.import-target
......
......@@ -7,6 +7,10 @@ module BitbucketServer
super(raw)
end
def project_key
raw.dig('project', 'key')
end
def project_name
raw.dig('project', 'name')
end
......
......@@ -50,6 +50,10 @@ describe BitbucketServer::Representation::Repo do
subject { described_class.new(JSON.parse(sample_data)) }
describe '#project_key' do
it { expect(subject.project_key).to eq('TEST') }
end
describe '#project_name' do
it { expect(subject.project_name).to eq('test') }
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