diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 03:10:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 03:10:25 +0000 |
commit | d8b3ba4b19f12a88a2aa6881bf770f9713a68d32 (patch) | |
tree | 2fc2ecd02a7edae8be4502240a09d709b6e8bb6a /spec/models/ci/runner_spec.rb | |
parent | 9f1ce98c1d456b962fc43ec99180e042592fa307 (diff) | |
download | gitlab-ce-d8b3ba4b19f12a88a2aa6881bf770f9713a68d32.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci/runner_spec.rb')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index c75d1faf48f..95b87c26c01 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -1737,6 +1737,24 @@ RSpec.describe Ci::Runner, feature_category: :runner do end end + describe '#short_sha' do + subject(:short_sha) { runner.short_sha } + + context 'when registered via command-line' do + let(:runner) { create(:ci_runner) } + + specify { expect(runner.token).not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) } + it { is_expected.not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) } + end + + context 'when creating new runner via UI' do + let(:runner) { create(:ci_runner, :created_via_ui) } + + specify { expect(runner.token).to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) } + it { is_expected.not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) } + end + end + describe '#token' do subject(:token) { runner.token } @@ -1746,8 +1764,8 @@ RSpec.describe Ci::Runner, feature_category: :runner do it { is_expected.not_to start_with('glrt-') } end - context 'when runner is created in UI' do - let(:runner) { create(:ci_runner, :created_in_ui) } + context 'when runner is created via UI' do + let(:runner) { create(:ci_runner, :created_via_ui) } it { is_expected.to start_with('glrt-') } end @@ -1986,7 +2004,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do end context 'when runner created via UI' do - let(:runner) { create(:ci_runner, :created_in_ui) } + let(:runner) { create(:ci_runner, :created_via_ui) } it { is_expected.to eq true } end |