diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 18:10:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-07 18:10:50 +0300 |
commit | 807c4eae46f96ccd54ce1d8d13f4547eda017267 (patch) | |
tree | 190aaf8d8c0a766fa7fc396355fd5e0d865db889 /spec/models | |
parent | ebe0e306bbd6e913763bf1865b7778c001994e31 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/job_artifact_spec.rb | 23 | ||||
-rw-r--r-- | spec/models/concerns/taskable_spec.rb | 16 |
2 files changed, 39 insertions, 0 deletions
diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index e94445f17cd..58b654ed65e 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -243,6 +243,29 @@ RSpec.describe Ci::JobArtifact, feature_category: :build_artifacts do end end + describe '.non_trace' do + subject { described_class.non_trace } + + context 'when there is only a trace job artifact' do + let!(:trace) { create(:ci_job_artifact, :trace) } + + it { is_expected.to be_empty } + end + + context 'when there is only a non-trace job artifact' do + let!(:junit) { create(:ci_job_artifact, :junit) } + + it { is_expected.to eq([junit]) } + end + + context 'when there are both trace and non-trace job artifacts' do + let!(:trace) { create(:ci_job_artifact, :trace) } + let!(:junit) { create(:ci_job_artifact, :junit) } + + it { is_expected.to eq([junit]) } + end + end + describe '.downloadable' do subject { described_class.downloadable } diff --git a/spec/models/concerns/taskable_spec.rb b/spec/models/concerns/taskable_spec.rb index 0ad29454ff3..14f346f353b 100644 --- a/spec/models/concerns/taskable_spec.rb +++ b/spec/models/concerns/taskable_spec.rb @@ -46,6 +46,22 @@ RSpec.describe Taskable, feature_category: :team_planning do subject { described_class.get_tasks(description) } it { is_expected.to match(expected_result) } + + describe 'with single line comments' do + let(:description) do + <<~MARKDOWN + <!-- line comment --> + + - [ ] only task item + + <!-- another line comment --> + MARKDOWN + end + + let(:expected_result) { [TaskList::Item.new('- [ ]', 'only task item')] } + + it { is_expected.to match(expected_result) } + end end describe '#task_list_items' do |