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

28 lines
677 B
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
require 'spec_helper'
require 'lib/gitlab/badge/shared/metadata'
2017-09-10 17:25:29 +05:30
describe Gitlab::Badge::Pipeline::Metadata do
let(:badge) { double(project: create(:project), ref: 'feature') }
2016-09-13 17:45:13 +05:30
let(:metadata) { described_class.new(badge) }
it_behaves_like 'badge metadata'
describe '#title' do
it 'returns build status title' do
2017-09-10 17:25:29 +05:30
expect(metadata.title).to eq 'pipeline status'
2016-09-13 17:45:13 +05:30
end
end
describe '#image_url' do
it 'returns valid url' do
2017-09-10 17:25:29 +05:30
expect(metadata.image_url).to include 'badges/feature/pipeline.svg'
2016-09-13 17:45:13 +05:30
end
end
describe '#link_url' do
it 'returns valid link' do
expect(metadata.link_url).to include 'commits/feature'
end
end
end