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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/workers/pages_worker_spec.rb
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/workers/pages_worker_spec.rb')
-rw-r--r--spec/workers/pages_worker_spec.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/spec/workers/pages_worker_spec.rb b/spec/workers/pages_worker_spec.rb
index ad714d8d11e..f0d29037fa4 100644
--- a/spec/workers/pages_worker_spec.rb
+++ b/spec/workers/pages_worker_spec.rb
@@ -3,14 +3,26 @@
require 'spec_helper'
RSpec.describe PagesWorker, :sidekiq_inline do
- let(:project) { create(:project) }
- let(:ci_build) { create(:ci_build, project: project) }
+ let_it_be(:ci_build) { create(:ci_build) }
- it 'calls UpdatePagesService' do
- expect_next_instance_of(Projects::UpdatePagesService, project, ci_build) do |service|
- expect(service).to receive(:execute)
+ context 'when called with the deploy action' do
+ it 'calls UpdatePagesService' do
+ expect_next_instance_of(Projects::UpdatePagesService, ci_build.project, ci_build) do |service|
+ expect(service).to receive(:execute)
+ end
+
+ described_class.perform_async(:deploy, ci_build.id)
end
+ end
- described_class.perform_async(:deploy, ci_build.id)
+ context 'when called with any other action' do
+ it 'does nothing' do
+ expect_next_instance_of(described_class) do |job_class|
+ expect(job_class).not_to receive(:foo)
+ expect(job_class).not_to receive(:deploy)
+ end
+
+ described_class.perform_async(:foo)
+ end
end
end