2016-12-02 08:21:04 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-12-05 05:35:27 -05:00
|
|
|
describe Gitlab::Ci::Status::Pipeline::Common do
|
2016-12-08 08:40:21 -05:00
|
|
|
let(:user) { create(:user) }
|
2016-12-08 08:51:38 -05:00
|
|
|
let(:project) { create(:empty_project) }
|
|
|
|
let(:pipeline) { create(:ci_pipeline, project: project) }
|
2016-12-02 08:21:04 -05:00
|
|
|
|
|
|
|
subject do
|
2016-12-05 05:35:27 -05:00
|
|
|
Class.new(Gitlab::Ci::Status::Core)
|
2016-12-08 08:40:21 -05:00
|
|
|
.new(pipeline, user)
|
|
|
|
.extend(described_class)
|
2016-12-02 08:21:04 -05:00
|
|
|
end
|
|
|
|
|
2016-12-08 08:51:38 -05:00
|
|
|
before do
|
|
|
|
project.team << [user, :developer]
|
|
|
|
end
|
|
|
|
|
2016-12-02 08:21:04 -05:00
|
|
|
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
|