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

33 lines
740 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'
require 'lib/gitlab/badge/shared/metadata'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::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