Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-24 11:02:56 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-08-24 11:02:56 +0300
commite65bc0f175c54d9df66fd4950972c0b0b08d448e (patch)
tree402d04d4b124490d431344e9895b6dc3153727f9 /spec/requests/projects
parentbc3493f9474d2557c1c30bf30a61e4cd51ece0f1 (diff)
Path could also have slashes! Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14347729
Diffstat (limited to 'spec/requests/projects')
-rw-r--r--spec/requests/projects/artifacts_controller_spec.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/requests/projects/artifacts_controller_spec.rb b/spec/requests/projects/artifacts_controller_spec.rb
index 3ba6725efc3..e02f0eacc93 100644
--- a/spec/requests/projects/artifacts_controller_spec.rb
+++ b/spec/requests/projects/artifacts_controller_spec.rb
@@ -26,8 +26,7 @@ describe Projects::ArtifactsController do
latest_succeeded_namespace_project_artifacts_path(
project.namespace,
project,
- ref,
- path,
+ [ref, path].join('/'),
job: job)
end
@@ -94,6 +93,25 @@ describe Projects::ArtifactsController do
it_behaves_like 'redirect to the build'
end
+
+ context 'with branch name and path containing slashes' do
+ before do
+ pipeline.update(ref: 'improve/awesome',
+ sha: project.commit('improve/awesome').sha)
+
+ get path_from_ref('improve/awesome', build.name, 'file/README.md')
+ end
+
+ it 'redirects' do
+ path = file_namespace_project_build_artifacts_path(
+ project.namespace,
+ project,
+ build,
+ 'README.md')
+
+ expect(response).to redirect_to(path)
+ end
+ end
end
end
end