Commit 3925436a authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent cf78c357
...@@ -191,8 +191,8 @@ describe API::API, api: true do ...@@ -191,8 +191,8 @@ describe API::API, api: true do
end end
context 'non-existing build' do context 'non-existing build' do
def verify shared_examples 'not found' do
expect(response).to have_http_status(404) it { expect(response).to have_http_status(:not_found) }
end end
context 'has no such ref' do context 'has no such ref' do
...@@ -200,7 +200,7 @@ describe API::API, api: true do ...@@ -200,7 +200,7 @@ describe API::API, api: true do
get path_for_ref('TAIL', build.name) get path_for_ref('TAIL', build.name)
end end
it('gives 404') { verify } it_behaves_like 'not found'
end end
context 'has no such build' do context 'has no such build' do
...@@ -208,7 +208,7 @@ describe API::API, api: true do ...@@ -208,7 +208,7 @@ describe API::API, api: true do
get path_for_ref(pipeline.ref, 'NOBUILD') get path_for_ref(pipeline.ref, 'NOBUILD')
end end
it('gives 404') { verify } it_behaves_like 'not found'
end end
end end
......
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