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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
721 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::Pipeline::Metadata do
2017-09-10 17:25:29 +05:30
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