diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-05 09:36:08 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-05 09:36:08 +0200 |
commit | f127183f37b2b456400500b47e782241e918b4df (patch) | |
tree | 2a11ae87a127afd2080a4a544b04a868fcfbbfed | |
parent | 0f30bcf15d325031912fdb041339902a164cf17b (diff) | |
download | gitlab-ce-feature/gb/add-test-example-for-commit-status-retries.tar.gz |
Add test example for external commit status retriesfeature/gb/add-test-example-for-commit-status-retries
-rw-r--r-- | spec/requests/api/commit_statuses_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/requests/api/commit_statuses_spec.rb b/spec/requests/api/commit_statuses_spec.rb index cdb60fc0d1a..8b62aa268d9 100644 --- a/spec/requests/api/commit_statuses_spec.rb +++ b/spec/requests/api/commit_statuses_spec.rb @@ -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' |