Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_related_branches.html.haml_spec.rb « issues « projects « views « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ba6f706802455adb1352dd3e2eca889e6a7ade25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'projects/issues/_related_branches' do
  include Devise::Test::ControllerHelpers

  let(:pipeline) { build(:ci_pipeline, :success) }
  let(:status) { pipeline.detailed_status(build(:user)) }

  before do
    assign(:related_branches, [
      { name: 'other', link: 'link-to-other', pipeline_status: nil },
      { name: 'feature', link: 'link-to-feature', pipeline_status: status }
    ])

    render
  end

  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')
    expect(rendered).to have_css('.related-branch-ci-status')
    expect(rendered).to have_css('.ci-status-icon')
    expect(rendered).to have_css('.related-branch-info')
  end
end