diff options
Diffstat (limited to 'spec/requests/api/deployments_spec.rb')
-rw-r--r-- | spec/requests/api/deployments_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/requests/api/deployments_spec.rb b/spec/requests/api/deployments_spec.rb index 38c96cd37af..69f7b54c277 100644 --- a/spec/requests/api/deployments_spec.rb +++ b/spec/requests/api/deployments_spec.rb @@ -376,6 +376,16 @@ RSpec.describe API::Deployments do expect(json_response['status']).to eq('success') end + it 'returns an error when an invalid status transition is detected' do + put( + api("/projects/#{project.id}/deployments/#{deploy.id}", user), + params: { status: 'running' } + ) + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['message']['status']).to include(%Q{cannot transition via \"run\"}) + end + it 'links merge requests when the deployment status changes to success', :sidekiq_inline do mr = create( :merge_request, |