Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-04 16:03:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-04 16:03:25 +0300
commit5ee4e9ad1869fca6cc8e5695126d9ca7391dc275 (patch)
tree710b55ebfeaf86ff0e17c2cf922431d5d1e04d56 /spec
parent7b81da9dd7775c048776d8b4acd117e022bce3ce (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-ee
Diffstat (limited to 'spec')
-rw-r--r--spec/services/projects/update_pages_service_spec.rb24
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