Commit 31e59264 authored by Lin Jen-Shin's avatar Lin Jen-Shin

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.
parent 1d51bc7d
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
%li.dropdown-header Previous Artifacts %li.dropdown-header Previous Artifacts
- artifacts.each do |job| - artifacts.each do |job|
%li %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 %i.fa.fa-download
%span Download '#{job.name}' %span Download '#{job.name}'
...@@ -33,7 +33,11 @@ feature 'Download buttons in branches page', feature: true do ...@@ -33,7 +33,11 @@ feature 'Download buttons in branches page', feature: true do
end end
scenario 'shows download artifacts button' do 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 end
end end
......
...@@ -34,7 +34,11 @@ feature 'Download buttons in files tree', feature: true do ...@@ -34,7 +34,11 @@ feature 'Download buttons in files tree', feature: true do
end end
scenario 'shows download artifacts button' do 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 end
end end
......
...@@ -33,7 +33,11 @@ feature 'Download buttons in project main page', feature: true do ...@@ -33,7 +33,11 @@ feature 'Download buttons in project main page', feature: true do
end end
scenario 'shows download artifacts button' do 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 end
end end
......
...@@ -34,7 +34,11 @@ feature 'Download buttons in tags page', feature: true do ...@@ -34,7 +34,11 @@ feature 'Download buttons in tags page', feature: true do
end end
scenario 'shows download artifacts button' do 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 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