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:
Diffstat (limited to 'spec/serializers/build_details_entity_spec.rb')
-rw-r--r--spec/serializers/build_details_entity_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb
index 86eaf160b38..a9d58b20861 100644
--- a/spec/serializers/build_details_entity_spec.rb
+++ b/spec/serializers/build_details_entity_spec.rb
@@ -298,5 +298,21 @@ RSpec.describe BuildDetailsEntity do
end
end
end
+
+ context 'when the build has annotations' do
+ let!(:build) { create(:ci_build) }
+ let!(:annotation) { create(:ci_job_annotation, job: build, name: 'external_links', data: [{ external_link: { label: 'URL', url: 'https://example.com/' } }]) }
+
+ it 'exposes job URLs' do
+ expect(subject[:annotations].count).to eq(1)
+ expect(subject[:annotations].first[:name]).to eq('external_links')
+ expect(subject[:annotations].first[:data]).to include(a_hash_including(
+ 'external_link' => a_hash_including(
+ 'label' => 'URL',
+ 'url' => 'https://example.com/'
+ )
+ ))
+ end
+ end
end
end