Commit c7c24940 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add implementation of common pipeline extended status

parent 0c7168b9
......@@ -4,6 +4,8 @@ module Gitlab::Ci
# Base abstract class fore core status
#
class Base
include Gitlab::Routing.url_helpers
def initialize(subject)
@subject = subject
end
......
......@@ -3,15 +3,14 @@ module Gitlab::Ci
module Extended
module Pipeline
module Common
def initialize(pipeline)
@pipeline = pipeline
end
def has_details?
true
end
def details_path
namespace_project_pipeline_path(@subject.project.namespace,
@subject.project,
@subject)
end
def has_action?
......
require 'spec_helper'
describe Gitlab::Ci::Status::Extended::Pipeline::Common do
let(:pipeline) { create(:ci_pipeline) }
subject do
Gitlab::Ci::Status::Core::Success
.new(pipeline).extend(described_class)
end
it 'does not have action' do
expect(subject).not_to have_action
end
it 'has details' do
expect(subject).to have_details
end
it 'links to the pipeline details page' do
expect(subject.details_path)
.to include "pipelines/#{pipeline.id}"
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment