summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-05 11:47:27 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-05 11:47:27 +0000
commit10723a1b26b009a83da8d3586888262db7fa76e5 (patch)
treea01a43ab24a97e65d1b35e60d9c15902b18e152e /spec/requests
parent0937eff145ff3d072527a84da22004f7dd00a00e (diff)
parentf127183f37b2b456400500b47e782241e918b4df (diff)
downloadgitlab-ce-10723a1b26b009a83da8d3586888262db7fa76e5.tar.gz
Merge branch 'feature/gb/add-test-example-for-commit-status-retries' into 'master'
Add test example for external commit status retries See merge request !12642
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/commit_statuses_spec.rb22
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'