Skip to content
Snippets Groups Projects
Commit 6c80b597 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Introduce path_from_ref and save some typing

parent bb5f0671
No related branches found
No related tags found
1 merge request!5142Add a download buttons for Build Artifacts
Pipeline #
Loading
Loading
@@ -50,12 +50,12 @@ describe Projects::ArtifactsController do
end
 
context '302' do
def path_from_sha
def path_from_ref(ref = pipeline.sha, build_name = build.name)
search_namespace_project_artifacts_path(
project.namespace,
project,
pipeline.sha,
build.name,
ref,
build_name,
'browse')
end
 
Loading
Loading
@@ -72,7 +72,7 @@ describe Projects::ArtifactsController do
 
context 'with sha' do
before do
get path_from_sha
get path_from_ref
end
 
it_behaves_like 'redirect to the build'
Loading
Loading
@@ -84,12 +84,7 @@ describe Projects::ArtifactsController do
end
 
before do
get search_namespace_project_artifacts_path(
project.namespace,
project,
'master',
build.name,
'browse')
get path_from_ref('master')
end
 
it_behaves_like 'redirect to the build'
Loading
Loading
@@ -101,12 +96,7 @@ describe Projects::ArtifactsController do
end
 
before do
get search_namespace_project_artifacts_path(
project.namespace,
project,
'improve/awesome',
build.name,
'browse')
get path_from_ref('improve/awesome')
end
 
it_behaves_like 'redirect to the build'
Loading
Loading
@@ -120,7 +110,7 @@ describe Projects::ArtifactsController do
end
 
before do
get path_from_sha
get path_from_ref
end
 
it_behaves_like 'redirect to the build'
Loading
Loading
@@ -133,7 +123,7 @@ describe Projects::ArtifactsController do
end
 
before do
get path_from_sha
get path_from_ref
end
 
it_behaves_like 'redirect to the build'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment