diff options
Diffstat (limited to 'spec/lib/api/entities/ci/pipeline_spec.rb')
-rw-r--r-- | spec/lib/api/entities/ci/pipeline_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/api/entities/ci/pipeline_spec.rb b/spec/lib/api/entities/ci/pipeline_spec.rb new file mode 100644 index 00000000000..6a658cc3e18 --- /dev/null +++ b/spec/lib/api/entities/ci/pipeline_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe API::Entities::Ci::Pipeline do + let_it_be(:pipeline) { create(:ci_empty_pipeline) } + let_it_be(:job) { create(:ci_build, name: "rspec", coverage: 30.212, pipeline: pipeline) } + + let(:entity) { described_class.new(pipeline) } + + subject { entity.as_json } + + it 'returns the coverage as a string' do + expect(subject[:coverage]).to eq '30.21' + end +end |