2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Ci::BridgePresenter do
|
2022-06-21 17:19:12 +05:30
|
|
|
let_it_be(:user) { create(:user) }
|
2020-03-13 15:44:24 +05:30
|
|
|
let_it_be(:project) { create(:project) }
|
|
|
|
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
|
2022-06-21 17:19:12 +05:30
|
|
|
let_it_be(:bridge) { create(:ci_bridge, pipeline: pipeline, status: :failed, user: user) }
|
2019-07-07 11:18:12 +05:30
|
|
|
|
|
|
|
subject(:presenter) do
|
|
|
|
described_class.new(bridge)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'presents information about recoverable state' do
|
|
|
|
expect(presenter).to be_recoverable
|
|
|
|
end
|
2022-06-21 17:19:12 +05:30
|
|
|
|
|
|
|
it 'presents the detailed status for the user' do
|
|
|
|
expect(bridge).to receive(:detailed_status).with(user)
|
|
|
|
|
|
|
|
presenter.detailed_status
|
|
|
|
end
|
2019-07-07 11:18:12 +05:30
|
|
|
end
|