summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-09-20 07:19:58 +0000
committerDouwe Maan <douwe@gitlab.com>2016-09-20 07:19:58 +0000
commitff49d28c7d285addd0d28bffbef14362a33c411d (patch)
tree061a740b112923ceef2cf1509c29205991dde15f
parentde548566df8069b0a0c4d7e5fcea81a14a0a8dbd (diff)
parent7c7c89ac702bb660c694baa1457031bb6b787716 (diff)
downloadgitlab-ce-ff49d28c7d285addd0d28bffbef14362a33c411d.tar.gz
Merge branch 'fix-download-artifacts-button-link' into 'master'
Fix download artifacts button link ## What does this MR do? Fix download artifacts button link. ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug ## What are the relevant issue numbers? Closes #22294 See merge request !6407
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/buttons/_download.html.haml2
-rw-r--r--spec/features/projects/branches/download_buttons_spec.rb6
-rw-r--r--spec/features/projects/files/download_buttons_spec.rb6
-rw-r--r--spec/features/projects/main/download_buttons_spec.rb6
-rw-r--r--spec/features/projects/tags/download_buttons_spec.rb6
6 files changed, 22 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0e328488fbe..7a19af6b765 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -29,6 +29,7 @@ v 8.12.0 (unreleased)
- Fix pagination on user snippets page
- Run CI builds with the permissions of users !5735
- Fix sorting of issues in API
+ - Fix download artifacts button links !6407
- Sort project variables by key. !6275 (Diego Souza)
- Ensure specs on sorting of issues in API are deterministic on MySQL
- Added ability to use predefined CI variables for environment name
diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml
index 5f5e071eb40..24de020917a 100644
--- a/app/views/projects/buttons/_download.html.haml
+++ b/app/views/projects/buttons/_download.html.haml
@@ -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}'
diff --git a/spec/features/projects/branches/download_buttons_spec.rb b/spec/features/projects/branches/download_buttons_spec.rb
index 04058300570..92028c19361 100644
--- a/spec/features/projects/branches/download_buttons_spec.rb
+++ b/spec/features/projects/branches/download_buttons_spec.rb
@@ -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
diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb
index be5cebcd7c9..d7c29a7e074 100644
--- a/spec/features/projects/files/download_buttons_spec.rb
+++ b/spec/features/projects/files/download_buttons_spec.rb
@@ -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
diff --git a/spec/features/projects/main/download_buttons_spec.rb b/spec/features/projects/main/download_buttons_spec.rb
index b26c0ea7a14..227ccf9459c 100644
--- a/spec/features/projects/main/download_buttons_spec.rb
+++ b/spec/features/projects/main/download_buttons_spec.rb
@@ -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
diff --git a/spec/features/projects/tags/download_buttons_spec.rb b/spec/features/projects/tags/download_buttons_spec.rb
index 6e0022c179f..dd93d25c2c6 100644
--- a/spec/features/projects/tags/download_buttons_spec.rb
+++ b/spec/features/projects/tags/download_buttons_spec.rb
@@ -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