Commit 3af0f6e6 authored by Tiffany Rea's avatar Tiffany Rea Committed by Dan Davison

Avoid checking when response is empty

parent d48d68e3
......@@ -49,9 +49,7 @@ module QA
let(:pipeline_data_request) { Runtime::API::Request.new(api_client, "/projects/#{project.id}/pipelines/#{pipeline_id}") }
before do
Support::Waiter.wait_until(max_duration: 30, sleep_interval: 3) do
JSON.parse(get(pipeline_data_request.url))['status'] != 'pending'
end
Support::Waiter.wait_until(sleep_interval: 3) { !pipeline.empty? && pipeline['status'] != 'pending' }
end
after do
......@@ -61,9 +59,21 @@ module QA
context 'when deleted via API' do
it 'is not found', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/931' do
delete(pipeline_data_request.url)
expect(JSON.parse(get(pipeline_data_request.url))['message'].downcase).to have_content('404 not found')
deleted_pipeline = nil
Support::Waiter.wait_until(sleep_interval: 3) do
deleted_pipeline = pipeline
!pipeline.empty?
end
expect(deleted_pipeline['message'].downcase).to have_content('404 not found')
end
end
private
def pipeline
JSON.parse(get(pipeline_data_request.url))
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