Fix download artifacts button link:

Rails ignored unused arguments and ref_name_and_path is the last
path argument, therefore we need to concatenate that parts ourselves.

Otherwise, 'download' won't be shown at all.
This commit is contained in:
Lin Jen-Shin 2016-09-19 13:12:45 +08:00
parent 1d51bc7dfd
commit 31e592647a
5 changed files with 21 additions and 5 deletions

View file

@ -37,6 +37,6 @@
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
= link_to latest_succeeded_namespace_project_artifacts_path(project.namespace, project, ref, 'download', job: job.name), rel: 'nofollow' do
= link_to latest_succeeded_namespace_project_artifacts_path(project.namespace, project, "#{ref}/download", job: job.name), rel: 'nofollow' do
%i.fa.fa-download
%span Download '#{job.name}'

View file

@ -33,7 +33,11 @@ feature 'Download buttons in branches page', feature: true do
end
scenario 'shows download artifacts button' do
expect(page).to have_link "Download '#{build.name}'"
href = latest_succeeded_namespace_project_artifacts_path(
project.namespace, project, 'binary-encoding/download',
job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
end
end
end

View file

@ -34,7 +34,11 @@ feature 'Download buttons in files tree', feature: true do
end
scenario 'shows download artifacts button' do
expect(page).to have_link "Download '#{build.name}'"
href = latest_succeeded_namespace_project_artifacts_path(
project.namespace, project, "#{project.default_branch}/download",
job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
end
end
end

View file

@ -33,7 +33,11 @@ feature 'Download buttons in project main page', feature: true do
end
scenario 'shows download artifacts button' do
expect(page).to have_link "Download '#{build.name}'"
href = latest_succeeded_namespace_project_artifacts_path(
project.namespace, project, "#{project.default_branch}/download",
job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
end
end
end

View file

@ -34,7 +34,11 @@ feature 'Download buttons in tags page', feature: true do
end
scenario 'shows download artifacts button' do
expect(page).to have_link "Download '#{build.name}'"
href = latest_succeeded_namespace_project_artifacts_path(
project.namespace, project, "#{tag}/download",
job: 'build')
expect(page).to have_link "Download '#{build.name}'", href: href
end
end
end