2019-10-08 08:06:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-07-27 11:26:29 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe 'projects/issues/_related_branches' do
|
2016-09-21 19:06:33 -04:00
|
|
|
include Devise::Test::ControllerHelpers
|
2016-07-27 11:26:29 -04:00
|
|
|
|
2020-05-04 02:10:10 -04:00
|
|
|
let(:pipeline) { build(:ci_pipeline, :success) }
|
|
|
|
let(:status) { pipeline.detailed_status(build(:user)) }
|
2016-07-27 11:26:29 -04:00
|
|
|
|
|
|
|
before do
|
2020-05-04 02:10:10 -04:00
|
|
|
assign(:related_branches, [
|
|
|
|
{ name: 'other', link: 'link-to-other', pipeline_status: nil },
|
|
|
|
{ name: 'feature', link: 'link-to-feature', pipeline_status: status }
|
|
|
|
])
|
2019-01-28 07:12:30 -05:00
|
|
|
|
2016-07-27 11:26:29 -04:00
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2020-05-04 02:10:10 -04:00
|
|
|
it 'shows the related branches with their build status', :aggregate_failures do
|
|
|
|
expect(rendered).to have_text('feature')
|
|
|
|
expect(rendered).to have_text('other')
|
|
|
|
expect(rendered).to have_link(href: 'link-to-feature')
|
|
|
|
expect(rendered).to have_link(href: 'link-to-other')
|
2016-07-27 11:26:29 -04:00
|
|
|
expect(rendered).to have_css('.related-branch-ci-status')
|
2020-05-04 02:10:10 -04:00
|
|
|
expect(rendered).to have_css('.ci-status-icon')
|
|
|
|
expect(rendered).to have_css('.related-branch-info')
|
2016-07-27 11:26:29 -04:00
|
|
|
end
|
|
|
|
end
|