diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-14 21:12:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-14 21:12:48 +0300 |
commit | 35f525b5e4c2246f2411f627d4c119c5b2c5ae81 (patch) | |
tree | faa8eb9ded77bae862b881e9128a919e74ad1c5e /spec/requests/api/commit_statuses_spec.rb | |
parent | c014b6b4e5c33180dd5cbff1dd1bb4623d1eca80 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/commit_statuses_spec.rb')
-rw-r--r-- | spec/requests/api/commit_statuses_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/commit_statuses_spec.rb b/spec/requests/api/commit_statuses_spec.rb index 39be28d7427..dc5d9620dc4 100644 --- a/spec/requests/api/commit_statuses_spec.rb +++ b/spec/requests/api/commit_statuses_spec.rb @@ -478,6 +478,26 @@ RSpec.describe API::CommitStatuses do .to include 'has already been taken' end end + + context 'with partitions' do + let(:current_partition_id) { 123 } + + before do + allow(Ci::Pipeline) + .to receive(:current_partition_value) { current_partition_id } + end + + it 'creates records in the current partition' do + expect { post api(post_url, developer), params: { state: 'running' } } + .to change(CommitStatus, :count).by(1) + .and change(Ci::Pipeline, :count).by(1) + + status = CommitStatus.find(json_response['id']) + + expect(status.partition_id).to eq(current_partition_id) + expect(status.pipeline.partition_id).to eq(current_partition_id) + end + end end context 'reporter user' do |