diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-09 06:08:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-09 06:08:43 +0000 |
commit | 3a8425c52044f6e2a52f0654b6f94577f9eda291 (patch) | |
tree | a61bc2870e2c5bd7c8b669c729feff5e3fdcbb5a /spec | |
parent | 37e1f8c80ec35e6833b0da7ac2f604ca67c91a17 (diff) | |
download | gitlab-ce-3a8425c52044f6e2a52f0654b6f94577f9eda291.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/build_spec.rb | 26 | ||||
-rw-r--r-- | spec/workers/ci/archive_trace_worker_spec.rb | 17 |
2 files changed, 26 insertions, 17 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index fef28e7c550..6d04fb86d22 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1554,6 +1554,32 @@ RSpec.describe Ci::Build do end end + describe '#count_user_verification?' do + subject { build.count_user_verification? } + + context 'when build is the verify action for the environment' do + let(:build) do + create(:ci_build, + ref: 'master', + environment: 'staging', + options: { environment: { action: 'verify' } }) + end + + it { is_expected.to be_truthy } + end + + context 'when build is not the verify action for the environment' do + let(:build) do + create(:ci_build, + ref: 'master', + environment: 'staging', + options: { environment: { action: 'start' } }) + end + + it { is_expected.to be_falsey } + end + end + describe '#expanded_environment_name' do subject { build.expanded_environment_name } diff --git a/spec/workers/ci/archive_trace_worker_spec.rb b/spec/workers/ci/archive_trace_worker_spec.rb index 52723ff5823..3ac769aab9e 100644 --- a/spec/workers/ci/archive_trace_worker_spec.rb +++ b/spec/workers/ci/archive_trace_worker_spec.rb @@ -27,23 +27,6 @@ RSpec.describe Ci::ArchiveTraceWorker do subject end - - context 'when sticky_ci_archive_trace_worker is disabled' do - before do - stub_feature_flags(sticky_ci_archive_trace_worker: false) - end - - it 'does not preload associations' do - allow_next_instance_of(Ci::ArchiveTraceService) do |instance| - allow(instance).to receive(:execute) do |job| - expect(job.association(:project)).not_to be_loaded - expect(job.association(:pending_state)).not_to be_loaded - end - end - - subject - end - end end context 'when job is not found' do |