Add pipeline bridge presenter
This commit is contained in:
parent
7700e02988
commit
9fe8106e34
2 changed files with 24 additions and 0 deletions
9
app/presenters/ci/bridge_presenter.rb
Normal file
9
app/presenters/ci/bridge_presenter.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Ci
|
||||||
|
class BridgePresenter < CommitStatusPresenter
|
||||||
|
def detailed_status
|
||||||
|
@detailed_status ||= subject.detailed_status(user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
15
spec/presenters/ci/bridge_presenter_spec.rb
Normal file
15
spec/presenters/ci/bridge_presenter_spec.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Ci::BridgePresenter do
|
||||||
|
set(:project) { create(:project) }
|
||||||
|
set(:pipeline) { create(:ci_pipeline, project: project) }
|
||||||
|
set(:bridge) { create(:ci_bridge, pipeline: pipeline, status: :failed) }
|
||||||
|
|
||||||
|
subject(:presenter) do
|
||||||
|
described_class.new(bridge)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'presents information about recoverable state' do
|
||||||
|
expect(presenter).to be_recoverable
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue