diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-24 16:02:56 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-08-24 16:02:56 +0800 |
commit | e65bc0f175c54d9df66fd4950972c0b0b08d448e (patch) | |
tree | 402d04d4b124490d431344e9895b6dc3153727f9 /spec/requests/projects | |
parent | bc3493f9474d2557c1c30bf30a61e4cd51ece0f1 (diff) | |
download | gitlab-ce-e65bc0f175c54d9df66fd4950972c0b0b08d448e.tar.gz |
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.rb | 22 |
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 |