summaryrefslogtreecommitdiff
path: root/spec/scripts/trigger-build_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/scripts/trigger-build_spec.rb
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
downloadgitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/scripts/trigger-build_spec.rb')
-rw-r--r--spec/scripts/trigger-build_spec.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/scripts/trigger-build_spec.rb b/spec/scripts/trigger-build_spec.rb
index 52682387e20..760b9bda541 100644
--- a/spec/scripts/trigger-build_spec.rb
+++ b/spec/scripts/trigger-build_spec.rb
@@ -6,7 +6,7 @@ require 'rspec-parameterized'
require_relative '../../scripts/trigger-build'
-RSpec.describe Trigger do
+RSpec.describe Trigger, feature_category: :tooling do
let(:env) do
{
'CI_JOB_URL' => 'ci_job_url',
@@ -362,6 +362,28 @@ RSpec.describe Trigger do
end
end
+ describe "GITLAB_REF_SLUG" do
+ context 'when CI_COMMIT_TAG is set' do
+ before do
+ stub_env('CI_COMMIT_TAG', 'true')
+ end
+
+ it 'sets GITLAB_REF_SLUG to CI_COMMIT_REF_NAME' do
+ expect(subject.variables['GITLAB_REF_SLUG']).to eq(env['CI_COMMIT_REF_NAME'])
+ end
+ end
+
+ context 'when CI_COMMIT_TAG is nil' do
+ before do
+ stub_env('CI_COMMIT_TAG', nil)
+ end
+
+ it 'sets GITLAB_REF_SLUG to CI_COMMIT_SHA' do
+ expect(subject.variables['GITLAB_REF_SLUG']).to eq(env['CI_COMMIT_SHA'])
+ end
+ end
+ end
+
describe "#version_param_value" do
using RSpec::Parameterized::TableSyntax