2016-08-11 07:58:57 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'lib/gitlab/badge/shared/metadata'
|
|
|
|
|
|
|
|
describe Gitlab::Badge::Coverage::Metadata do
|
|
|
|
let(:badge) do
|
2017-08-02 15:55:11 -04:00
|
|
|
double(project: create(:project), ref: 'feature', job: 'test')
|
2016-08-11 07:58:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
let(:metadata) { described_class.new(badge) }
|
|
|
|
|
|
|
|
it_behaves_like 'badge metadata'
|
|
|
|
|
2016-08-11 08:08:27 -04:00
|
|
|
describe '#title' do
|
|
|
|
it 'returns coverage report title' do
|
|
|
|
expect(metadata.title).to eq 'coverage report'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-11 07:58:57 -04:00
|
|
|
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
|