Commit 423eb472 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'morefice/add-missing-specs-ci-entities' into 'master'

Add missing specs for API::Entities::Ci

See merge request gitlab-org/gitlab!82507
parents cac6b322 c5a3d8cb
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::Entities::Ci::JobArtifactFile do
let(:artifact_file) { instance_double(JobArtifactUploader, filename: 'ci_build_artifacts.zip', cached_size: 42) }
let(:entity) { described_class.new(artifact_file) }
subject { entity.as_json }
it 'returns the filename' do
expect(subject[:filename]).to eq('ci_build_artifacts.zip')
end
it 'returns the size' do
expect(subject[:size]).to eq(42)
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::Entities::Ci::JobRequest::Dependency do
let(:job) { create(:ci_build, :artifacts) }
let(:entity) { described_class.new(job) }
subject { entity.as_json }
it 'returns the dependency id' do
expect(subject[:id]).to eq(job.id)
end
it 'returns the dependency name' do
expect(subject[:name]).to eq(job.name)
end
it 'returns the dependency token' do
expect(subject[:token]).to eq(job.token)
end
it 'returns the dependency artifacts_file', :aggregate_failures do
expect(subject[:artifacts_file][:filename]).to eq('ci_build_artifacts.zip')
expect(subject[:artifacts_file][:size]).to eq(job.artifacts_size)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment