gitlab-org--gitlab-foss/spec/lib/gitlab/badge/pipeline/metadata_spec.rb
Z.J. van de Weg 2086483b24 Rename build to pipeline for status badges
First commit in probably 2, for resolve gitlab-org/gitlab-ce#15582. This
commit is renaming files and classes from build to pipeline. Also
wording is editted to pipeline. Given `pipeline` had more characters
than `build`, I've made the field a bit wider. The width now matchers
the one for the coverage badge, so they look nice when in a table
format, or in a list.

As soon as this commit is merged to master, and released, the build.svg
is deprecated, meaning that all users which already placed a badge
should update it. However, to make sure it keeps working tests are added
for this case.
2017-07-21 10:22:09 +02:00

27 lines
683 B
Ruby

require 'spec_helper'
require 'lib/gitlab/badge/shared/metadata'
describe Gitlab::Badge::Pipeline::Metadata do
let(:badge) { double(project: create(:empty_project), ref: 'feature') }
let(:metadata) { described_class.new(badge) }
it_behaves_like 'badge metadata'
describe '#title' do
it 'returns build status title' do
expect(metadata.title).to eq 'pipeline status'
end
end
describe '#image_url' do
it 'returns valid url' do
expect(metadata.image_url).to include 'badges/feature/pipeline.svg'
end
end
describe '#link_url' do
it 'returns valid link' do
expect(metadata.link_url).to include 'commits/feature'
end
end
end