debian-mirror-gitlab/spec/views/projects/issues/_related_branches.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
944 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'projects/issues/_related_branches' do
2016-11-03 12:29:30 +05:30
include Devise::Test::ControllerHelpers
2016-09-13 17:45:13 +05:30
2020-05-24 23:13:21 +05:30
let(:pipeline) { build(:ci_pipeline, :success) }
let(:status) { pipeline.detailed_status(build(:user)) }
2016-09-13 17:45:13 +05:30
before do
2020-05-24 23:13:21 +05:30
assign(:related_branches, [
{ name: 'other', link: 'link-to-other', pipeline_status: nil },
{ name: 'feature', link: 'link-to-feature', pipeline_status: status }
])
2019-02-02 18:00:53 +05:30
2016-09-13 17:45:13 +05:30
render
end
2020-05-24 23:13:21 +05:30
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-09-13 17:45:13 +05:30
expect(rendered).to have_css('.related-branch-ci-status')
2020-05-24 23:13:21 +05:30
expect(rendered).to have_css('.ci-status-icon')
expect(rendered).to have_css('.related-branch-info')
2016-09-13 17:45:13 +05:30
end
end