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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-06 12:09:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-06 12:09:03 +0300
commit61ee5c363522f2639d1c515a74b9b02b7672c7c2 (patch)
tree65905860063ad3af3c31656b6aa1ca6f8fe36856 /spec/serializers
parent5e230e10b86a9b65eb5a7aa532879fe7456003e6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/build_artifact_entity_spec.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/serializers/build_artifact_entity_spec.rb b/spec/serializers/build_artifact_entity_spec.rb
index 87c1874ec41..3d4dc3f69c9 100644
--- a/spec/serializers/build_artifact_entity_spec.rb
+++ b/spec/serializers/build_artifact_entity_spec.rb
@@ -3,11 +3,13 @@
require 'spec_helper'
RSpec.describe BuildArtifactEntity do
- let(:job) { create(:ci_build) }
- let(:artifact) { create(:ci_job_artifact, :codequality, expire_at: 1.hour.from_now, job: job) }
+ let_it_be(:job) { create(:ci_build) }
+ let_it_be(:artifact) { create(:ci_job_artifact, :codequality, expire_at: 1.hour.from_now, job: job) }
+
+ let(:options) { { request: double } }
let(:entity) do
- described_class.new(artifact, request: double)
+ described_class.represent(artifact, options)
end
describe '#as_json' do
@@ -46,5 +48,15 @@ RSpec.describe BuildArtifactEntity do
expect(subject[:browse_path]).to be_present
end
end
+
+ context 'when project is specified in options' do
+ let(:options) { super().merge(project: job.project) }
+
+ it 'doesnt get a project from the artifact' do
+ expect(artifact).not_to receive(:project)
+
+ subject
+ end
+ end
end
end