summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-12 15:16:16 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-14 12:48:16 +0100
commit6d7a77074fcdd57ccdc33e3cb39146da4afdc0f4 (patch)
tree1b6be1d49e7642afb71cb7fe913f24fff10b806c
parente8995f9fd5c12882eafcf3766627f64a3d6f623d (diff)
downloadgitlab-ce-6d7a77074fcdd57ccdc33e3cb39146da4afdc0f4.tar.gz
Add specs for endpoint meant to be accelerated by workhorse
-rw-r--r--app/views/projects/artifacts/_tree_file.html.haml2
-rw-r--r--features/project/builds.feature8
-rw-r--r--features/steps/project/builds.rb11
3 files changed, 20 insertions, 1 deletions
diff --git a/app/views/projects/artifacts/_tree_file.html.haml b/app/views/projects/artifacts/_tree_file.html.haml
index 881a844a02d..1d3d9306aa6 100644
--- a/app/views/projects/artifacts/_tree_file.html.haml
+++ b/app/views/projects/artifacts/_tree_file.html.haml
@@ -7,5 +7,5 @@
= number_to_human_size(file.metadata[:size], precision: 2)
%td
= link_to file_namespace_project_build_artifacts_path(path: file.path),
- class: 'btn btn-xs btn-default' do
+ class: 'btn btn-xs btn-default artifact-download' do
= icon('download')
diff --git a/features/project/builds.feature b/features/project/builds.feature
index e7626222f7f..c00b0a7ae07 100644
--- a/features/project/builds.feature
+++ b/features/project/builds.feature
@@ -48,3 +48,11 @@ Feature: Project Builds
And I click artifacts browse button
And I navigate to parent directory of directory with invalid name
Then I should not see directory with invalid name on the list
+
+ Scenario: I download a single file from build artifacts
+ Given recent build has artifacts available
+ And recent build has artifacts metadata available
+ When I visit recent build summary page
+ And I click artifacts browse button
+ And I click download button for a file within build artifacts
+ Then download of a file extracted from build artifacts should start
diff --git a/features/steps/project/builds.rb b/features/steps/project/builds.rb
index 12d0dd24427..5702496ac84 100644
--- a/features/steps/project/builds.rb
+++ b/features/steps/project/builds.rb
@@ -75,4 +75,15 @@ class Spinach::Features::ProjectBuilds < Spinach::FeatureSteps
expect(page).to have_no_content('non-utf8-dir')
end
end
+
+ step 'I click download button for a file within build artifacts' do
+ page.within('.tree-table') { first('.artifact-download').click }
+ end
+
+ step 'download of a file extracted from build artifacts should start' do
+ # this will be accelerated by Workhorse
+ response_json = JSON.parse(page.body, symbolize_names: true)
+ expect(response_json[:archive]).to end_with('build_artifacts.zip')
+ expect(response_json[:path]).to eq Base64.encode64('ci_artifacts.txt')
+ end
end