Commit ae83ac99 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 6da27aa6
...@@ -201,7 +201,7 @@ describe API::API, api: true do ...@@ -201,7 +201,7 @@ describe API::API, api: true do
project.team << [user, :developer] project.team << [user, :developer]
end end
def path_from_ref(ref = pipeline.ref, job = build.name) def path_for_ref(ref = pipeline.ref, job = build.name)
api("/projects/#{project.id}/builds/artifacts/#{ref}/download?job=#{job}", user) api("/projects/#{project.id}/builds/artifacts/#{ref}/download?job=#{job}", user)
end end
...@@ -209,7 +209,7 @@ describe API::API, api: true do ...@@ -209,7 +209,7 @@ describe API::API, api: true do
let(:user) { nil } let(:user) { nil }
before do before do
get path_from_ref get path_for_ref
end end
it { expect(response).to have_http_status(401) } it { expect(response).to have_http_status(401) }
...@@ -222,7 +222,7 @@ describe API::API, api: true do ...@@ -222,7 +222,7 @@ describe API::API, api: true do
context 'has no such ref' do context 'has no such ref' do
before do before do
get path_from_ref('TAIL', build.name) get path_for_ref('TAIL', build.name)
end end
it('gives 404') { verify } it('gives 404') { verify }
...@@ -230,7 +230,7 @@ describe API::API, api: true do ...@@ -230,7 +230,7 @@ describe API::API, api: true do
context 'has no such build' do context 'has no such build' do
before do before do
get path_from_ref(pipeline.ref, 'NOBUILD') get path_for_ref(pipeline.ref, 'NOBUILD')
end end
it('gives 404') { verify } it('gives 404') { verify }
...@@ -260,7 +260,7 @@ describe API::API, api: true do ...@@ -260,7 +260,7 @@ describe API::API, api: true do
end end
before do before do
get path_from_ref('master') get path_for_ref('master')
end end
it('gives the file') { verify } it('gives the file') { verify }
...@@ -273,7 +273,7 @@ describe API::API, api: true do ...@@ -273,7 +273,7 @@ describe API::API, api: true do
end end
before do before do
get path_from_ref('improve/awesome') get path_for_ref('improve/awesome')
end end
it('gives the file') { verify } it('gives the file') { verify }
...@@ -287,7 +287,7 @@ describe API::API, api: true do ...@@ -287,7 +287,7 @@ describe API::API, api: true do
end end
before do before do
get path_from_ref get path_for_ref
end end
it('gives the file') { verify } it('gives the file') { verify }
...@@ -300,7 +300,7 @@ describe API::API, api: true do ...@@ -300,7 +300,7 @@ describe API::API, api: true do
end end
before do before do
get path_from_ref get path_for_ref
end end
it('gives the file') { verify } it('gives the file') { verify }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment