2020-08-12 11:10:02 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'projects/pipelines/new' do
|
|
|
|
include Devise::Test::ControllerHelpers
|
|
|
|
let_it_be(:project) { create(:project, :repository) }
|
|
|
|
let(:pipeline) { create(:ci_pipeline, project: project) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
assign(:project, project)
|
|
|
|
assign(:pipeline, pipeline)
|
|
|
|
|
|
|
|
stub_feature_flags(new_pipeline_form: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'warning messages' do
|
|
|
|
let(:warning_messages) do
|
|
|
|
[double(content: 'warning 1'), double(content: 'warning 2')]
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
|
|
|
allow(pipeline).to receive(:warning_messages).and_return(warning_messages)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'displays the warnings' do
|
|
|
|
render
|
|
|
|
|
2020-09-03 02:08:22 -04:00
|
|
|
expect(rendered).to have_css('div.bs-callout-warning')
|
2020-08-12 11:10:02 -04:00
|
|
|
expect(rendered).to have_content('warning 1')
|
|
|
|
expect(rendered).to have_content('warning 2')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|