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
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/projects/update_pages_service_spec.rb')
-rw-r--r--spec/services/projects/update_pages_service_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb
index 24b5e35e422..eea2ea3271f 100644
--- a/spec/services/projects/update_pages_service_spec.rb
+++ b/spec/services/projects/update_pages_service_spec.rb
@@ -19,6 +19,25 @@ RSpec.describe Projects::UpdatePagesService do
subject { described_class.new(project, build) }
+ context 'when a deploy stage already exists' do
+ let!(:stage) { create(:ci_stage, name: 'deploy', pipeline: pipeline) }
+
+ it 'assigns the deploy stage' do
+ subject.execute
+
+ expect(GenericCommitStatus.last.ci_stage).to eq(stage)
+ expect(GenericCommitStatus.last.ci_stage.name).to eq('deploy')
+ end
+ end
+
+ context 'when a deploy stage does not exists' do
+ it 'assigns the deploy stage' do
+ subject.execute
+
+ expect(GenericCommitStatus.last.ci_stage.name).to eq('deploy')
+ end
+ end
+
context 'for new artifacts' do
context "for a valid job" do
let!(:artifacts_archive) { create(:ci_job_artifact, :correct_checksum, file: file, job: build) }