Commit f127183f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add test example for external commit status retries

parent 0f30bcf1
......@@ -237,6 +237,28 @@ describe API::CommitStatuses do
end
end
context 'when retrying a commit status' do
before do
post api(post_url, developer),
{ state: 'failed', name: 'test', ref: 'master' }
post api(post_url, developer),
{ state: 'success', name: 'test', ref: 'master' }
end
it 'correctly posts a new commit status' do
expect(response).to have_http_status(201)
expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success')
end
it 'retries a commit status' do
expect(CommitStatus.count).to eq 2
expect(CommitStatus.first).to be_retried
expect(CommitStatus.last.pipeline).to be_success
end
end
context 'when status is invalid' do
before do
post api(post_url, developer), state: 'invalid'
......
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