Use shared_examples, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13173599
This commit is contained in:
parent
cf78c35701
commit
3925436a95
1 changed files with 4 additions and 4 deletions
|
@ -191,8 +191,8 @@ describe API::API, api: true do
|
|||
end
|
||||
|
||||
context 'non-existing build' do
|
||||
def verify
|
||||
expect(response).to have_http_status(404)
|
||||
shared_examples 'not found' do
|
||||
it { expect(response).to have_http_status(:not_found) }
|
||||
end
|
||||
|
||||
context 'has no such ref' do
|
||||
|
@ -200,7 +200,7 @@ describe API::API, api: true do
|
|||
get path_for_ref('TAIL', build.name)
|
||||
end
|
||||
|
||||
it('gives 404') { verify }
|
||||
it_behaves_like 'not found'
|
||||
end
|
||||
|
||||
context 'has no such build' do
|
||||
|
@ -208,7 +208,7 @@ describe API::API, api: true do
|
|||
get path_for_ref(pipeline.ref, 'NOBUILD')
|
||||
end
|
||||
|
||||
it('gives 404') { verify }
|
||||
it_behaves_like 'not found'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue