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