debian-mirror-gitlab/spec/lib/gitlab/ci/badge/coverage/metadata_spec.rb

33 lines
747 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
require 'spec_helper'
2021-03-11 19:13:27 +05:30
require 'lib/gitlab/ci/badge/shared/metadata'
2016-09-13 17:45:13 +05:30
2021-03-11 19:13:27 +05:30
RSpec.describe Gitlab::Ci::Badge::Coverage::Metadata do
2016-09-13 17:45:13 +05:30
let(:badge) do
2017-09-10 17:25:29 +05:30
double(project: create(:project), ref: 'feature', job: 'test')
2016-09-13 17:45:13 +05:30
end
let(:metadata) { described_class.new(badge) }
it_behaves_like 'badge metadata'
describe '#title' do
it 'returns coverage report title' do
expect(metadata.title).to eq 'coverage report'
end
end
describe '#image_url' do
it 'returns valid url' do
expect(metadata.image_url).to include 'badges/feature/coverage.svg'
end
end
describe '#link_url' do
it 'returns valid link' do
expect(metadata.link_url).to include 'commits/feature'
end
end
end