diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 13:03:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 13:03:25 +0000 |
commit | 5ee4e9ad1869fca6cc8e5695126d9ca7391dc275 (patch) | |
tree | 710b55ebfeaf86ff0e17c2cf922431d5d1e04d56 /spec/services | |
parent | 7b81da9dd7775c048776d8b4acd117e022bce3ce (diff) | |
download | gitlab-ce-5ee4e9ad1869fca6cc8e5695126d9ca7391dc275.tar.gz |
Add latest changes from gitlab-org/gitlab@15-4-stable-ee
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/update_pages_service_spec.rb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb index eea2ea3271f..a69db3b9970 100644 --- a/spec/services/projects/update_pages_service_spec.rb +++ b/spec/services/projects/update_pages_service_spec.rb @@ -19,22 +19,34 @@ RSpec.describe Projects::UpdatePagesService do subject { described_class.new(project, build) } - context 'when a deploy stage already exists' do + context 'when a deploy stage already exists', :aggregate_failures do let!(:stage) { create(:ci_stage, name: 'deploy', pipeline: pipeline) } it 'assigns the deploy stage' do - subject.execute + expect { subject.execute } + .to change(GenericCommitStatus, :count).by(1) + .and change(Ci::Stage.where(name: 'deploy'), :count).by(0) - expect(GenericCommitStatus.last.ci_stage).to eq(stage) - expect(GenericCommitStatus.last.ci_stage.name).to eq('deploy') + status = GenericCommitStatus.last + + expect(status.ci_stage).to eq(stage) + expect(status.ci_stage.name).to eq('deploy') + expect(status.stage_name).to eq('deploy') + expect(status.stage).to eq('deploy') end end context 'when a deploy stage does not exists' do it 'assigns the deploy stage' do - subject.execute + expect { subject.execute } + .to change(GenericCommitStatus, :count).by(1) + .and change(Ci::Stage.where(name: 'deploy'), :count).by(1) + + status = GenericCommitStatus.last - expect(GenericCommitStatus.last.ci_stage.name).to eq('deploy') + expect(status.ci_stage.name).to eq('deploy') + expect(status.stage_name).to eq('deploy') + expect(status.stage).to eq('deploy') end end |